HKCU\Software\Microsoft\Command Processor

Data type


Default value


0 | 1



Determines whether the command processor supports delayed expansion of environment variables. If the value of this entry is 1, the command processor interprets an exclamation point, "!", as an environment variable that is expanded only when used.

By default, the command processor expands variables when it reads a line of text. However, you can direct the command processor to expand a variable only when it is used. If you do this, you can include variables in compound conditional statements and prevent them from being set before they are tested.




Delayed expansion is not supported. The command processor expands environment variables when it reads them, and it does not interpret exclamation points as delayed variables.


Delayed expansion is supported. The system expands environment variables surrounded by exclamation points, such as !VAR!, only when they are used.

Change method

To change the value of this entry, run the Command Processor (Cmd.exe) and type cmd /v:on.

Note Image Note

DelayedExpansion can appear in HKEY_LOCAL_MACHINE and in HKEY_CURRENT_USER. If both appear in the registry, the value of the entry in HKEY_CURRENT_USER takes precedence over the value in HKEY_LOCAL_MACHINE.

Windows 2000 does not add this entry to the registry. You can add it by editing the registry or by using a program that edits the registry. Even when this entry appears in the registry, the setting of the command line switch, /v , takes precedence over it.

Tip Image Tip

For more details, run the Command Processor (Cmd.exe) and type help set or cmd /?, and read the entry on the /v command.

Related Entries

Page Image

DelayedExpansion (in HKLM)