|
| |
|
K
E
Y |
Common Commands |
INTERNAL |
External |
/SWITCH |
Parameter |
Help text |
AddonTool |
|
Mounted Commands |
.Mount/\Command |
CmdShorthand |
#Constant |
$FUNCTION |
:Procedure |
!GuardNote |
|
Operating Systems |
NT/2K/XP/K3 |
NT Only |
NT/2K |
2K Only |
2K/XP |
XP Only |
XP/K3 |
K3 Only |
2K/XP/K3 |
Related Resources from the NT/2K/XP/K3 Command Library
|
Resource |
|
Short Description |
| |
|
|
Go straight to !GuardNotes. (updated
2004-07-13)
This is the Mounted Help Text. We also archive the Common Help Text
for NT,
2K, XP
and K3
Description
Begins localization of environment changes in a batch file.
Environment changes made after SETLOCAL has been issued are local to the batch file.
ENDLOCAL must be issued to restore the previous settings. When the end of a batch script is
reached, an implied ENDLOCAL is executed
for any outstanding SETLOCAL commands
issued by that batch script.
Syntax
Parameters and Switches
Examples, Notes and Instructions
If Command Extensions are enabled SETLOCAL changes as follows:
SETLOCAL batch command
now accepts an optional argument, which can be either ENABLEEXTENSIONS or
DISABLEEXTENSIONS. This will enable or disable the Command process extensions until the matching
ENDLOCAL
command, regardless of their setting prior to the
SETLOCAL command.
SETLOCAL batch command now accepts optional
arguments:
ENABLEEXTENSIONS / DISABLEEXTENSIONS
enable or disable command processor extensions. See
CMD /?
for details.
ENABLEDELAYEDEXPANSION /
DISABLEDELAYEDEXPANSION
enable or disable delayed environment variable expansion. See
SET /? for details.
These modifications last until the matching ENDLOCAL
command, regardless of their setting prior to the SETLOCAL
command.
The SETLOCAL command will set the ERRORLEVEL value if given an argument. It will be zero if one of the two valid arguments is
given and one otherwise. You can use this in batch scripts to determine if the extensions are available, using the following technique:
VERIFY OTHER 2>nul
SETLOCAL ENABLEEXTENSIONS
IF ERRORLEVEL 1 echo Unable to enable extensions
This works because on old versions of CMD.EXE, SETLOCAL does NOT set the
ERRORLEVEL value. The VERIFY command with a bad argument initializes the ERRORLEVEL value to a non-zero value.
GuardNotes
Things that are different (by design, by accident or otherwise)
None documented (yet).
|