Enable Delayed Environment Variable Expansion (Windows 2000/XP) Category: Home > Windows > Accessories > Command Processor
This setting allows you to enable or disable delayed environment variable expansion in the command processor. If this feature is enabled then exclaimation characters can be used to substitute the value of an environment variable at execution time.
Open your registry and find the key below.
Create a new DWORD value called "DelayedExpansion" and set it to equal "1" to enabled variable expansion or "0" to disable it.
Delayed expansion will be available the next time the command processor is used. To access variables surround the variable name with exclaimation characters i.e. "!varname!". For example to echo the PATH variable you could use the following command:
echo !path!
 |  |  |  |  |
 |  | (Default) | REG_SZ | (value not set) |  |
 |  | DelayedExpansion | REG_DWORD | 0x00000001 (1) |  |
 |
 | HKEY_CURRENT_USER\Software\Microsoft\Command Processor |  |
 |
Settings: |
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
Name: DelayedExpansion
Type: REG_DWORD (DWORD Value)
Value: (0 = disabled, 1 = enabled)
|
Disclaimer: Modifying the registry can cause serious problems that may require you to reinstall your operating system. We cannot guarantee that problems resulting from modifications to the registry can be solved. Use the information provided at your own risk.
Last Modified: March 8, 2001
|