File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,16 @@ call :%* ""
77goto :eof
88
99
10- :getx < RESULT_VAR> [/M]
10+ :getx [ < RESULT_VAR> ] [/M]
1111 :: counterpart to setx command
1212 setlocal
13- set result_var = %~1
14- set system_wide = %~2
13+ if " %~1 " == " /M" (
14+ set result_var = %~2
15+ set system_wide = %~1
16+ ) else (
17+ set result_var = %~1
18+ set system_wide = %~2
19+ )
1520 if /I " %system_wide% " == " /M" (
1621 set " reg_path = HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
1722 ) else (
@@ -28,7 +33,7 @@ goto :eof
2833goto :eof
2934
3035
31- :get_windows_major_version < RESULT_VAR>
36+ :get_windows_major_version [ < RESULT_VAR> ]
3237 setlocal
3338 set result_var = %~1
3439 for /F " tokens=4-5 delims=. " %%i in ('ver') do set win_major_ver = %%i
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ goto :eof
2424goto :eof
2525
2626
27- :replace_substrings < SEARCH_IN> < SEARCH_FOR> < REPLACE_WITH> < RESULT_VAR>
27+ :replace_substrings < SEARCH_IN> < SEARCH_FOR> < REPLACE_WITH> [ < RESULT_VAR> ]
2828 :: replace all matching substrings
2929 setlocal
3030 set search_in = %~1
@@ -42,7 +42,7 @@ goto :eof
4242goto :eof
4343
4444
45- :substring_before < SEARCH_IN> < SEARCH_FOR> < RESULT_VAR>
45+ :substring_before < SEARCH_IN> < SEARCH_FOR> [ < RESULT_VAR> ]
4646 setlocal
4747 set search_in = %~1
4848 set separator = %~2
You can’t perform that action at this time.
0 commit comments