According to this page on setlocal Windows batch command, Command Extensions are enabled by default. Are there any Windows systems where it is not enable by default? Do I really need to explicitly include setlocal EnableExtensions
in any of my batch scripts?
By default command extensions are enabled. However, to be absolutely sure that they are, either use SETLOCAL ENABLEEXTENSIONS within your NT shell scripts (batch files) or execute those scripts using CMD /X . Likewise, you may disable command extensions using SETLOCAL DISABLEEXTENSIONS or CMD /Y .
Open Command Prompt in Windows 10 Move the mouse pointer to the bottom-left corner of the screen and Right-click, or press Windows key + X. In the power user task menu, select Command Prompt (Admin) (Figure 8). This will open the Command Prompt window (Figure 9).
When cmd.exe is started, command extensions are enabled or disabled by giving either the /e:on or /e:off option. In a batch file, command extensions can be enabled with setlocal enableExtension . Command extensions affect the following commands and features.
They can always be disabled in the registry and if that's possible there are probably systems where it's the case. I haven't found any such system, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With