Disabling Command Extensions
To run an old batch file that does not function with the extended version of CMD's built-in commands, you can explicitly disable extensions with /e:off on the CMD command line. For example, to run an incompatible batch file, use the following:
cmd /e:off oldbatch.bat
If this needs to be the rule rather than the exception, you have my sympathies, and you can disable extensions by default through the Registry key HKLM\Software\Microsoft\Command Processor\EnableExtensions. If this DWORD value is present and set to 0, command extensions are disabled.You can use /e:on on the command line to enable extensions for a particular instance of CMD.
In this tutorial:
- The CMD Command-Line
- CMD Versus COMMAND
- Running CMD
- Opening a Command Prompt Window with Administrator Privileges
- CMD Options
- Disabling Command Extensions
- Command-Line Processing
- Console Program Input and Output
- Using the Console Window
- I/O Redirection and Pipes
- Copy and Paste in Command Prompt Windows
- Command Editing and the History List
- Name Completion
- Enabling Directory Name Completion
- Multiple Commands on One Line
- Grouping Commands with Parentheses
- Arguments, Commas, and Quotes
- Escaping Special Characters
- Configuring the CMD Program
- The Search Path
- Changing the Path
- Predefined and Virtual Environment Variables
- Setting Default Environment Variables
- Built-in Commands
- Extended Commands
- Listing Files with the Dir Command
- Paginating Long Listings
- Printing Directory Listings
- Sorting Listings
- Locating Alternate File Streams
- Setting Variables with the Set Command
- Conditional Processing with the if Command
- Scanning for Files with the for Command
- Using the for Command's Variable
- Processing Directories
- Numerical for Loop
- Getting More Information