win: improve script environment robustness #221
This commit ensures the script functions as expected, even when invoked from unexpected environments. Using `setlocal` initializes a distinct environment for privacy.sexy. It's strategically placed after the admin privilege check to avoid unnecessary setup in case of a relaunch. The script concludes with `endlocal` right before the exit, maintaining a clean environment throughout its execution and ensuring no unintentional global environment modifications. Changes: - Enhance script's environment robustness. - Add descriptive comments for script start/end sequences.
This commit is contained in:
@@ -14,8 +14,14 @@ scripting:
|
|||||||
)
|
)
|
||||||
exit 0
|
exit 0
|
||||||
)
|
)
|
||||||
|
:: Initialize environment
|
||||||
|
setlocal EnableExtensions DisableDelayedExpansion
|
||||||
endCode: |-
|
endCode: |-
|
||||||
|
:: Pause the script to view the final state
|
||||||
pause
|
pause
|
||||||
|
:: Restore previous environment settings
|
||||||
|
endlocal
|
||||||
|
:: Exit the script successfully
|
||||||
exit /b 0
|
exit /b 0
|
||||||
actions:
|
actions:
|
||||||
-
|
-
|
||||||
|
|||||||
Reference in New Issue
Block a user