Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DelayedExpansion

HKCU\Software\Microsoft\Command Processor

Data type

Range

Default value

REG_DWORD

0 | 1

0

Description

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.

Value

Meaning

0

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.

1

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)

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.