|
| |
|
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
Ends localization of environment changes in a batch file.
Syntax
Parameters and Switches
None.
Examples, Notes and Instructions
Environment changes made after ENDLOCAL has been issued are not local to the batch file; the previous settings are not restored on
termination of the batch file.
If Command Extensions are enabled ENDLOCAL changes as follows:
If the corresponding SETLOCAL enable or disabled command extensions using the
new ENABLEEXTENSIONS or DISABLEEXTENSIONS options, then after the ENDLOCAL, the enabled/disabled state of command
extensions will be restored to what it was prior to the matching SETLOCAL
command execution.
GuardNotes
Things that are different (by design, by accident or otherwise)
Variable transfer from the "localized" environment to the "parent" environment
ENDLOCAL will allow selected variables to be transferred from the "local" environment to the "parent" environment if the transfer
occurs on the same "logical" line as the ENDLOCAL command.
ENDLOCAL & (
SET OutputVar1=%LocalVar1%
SET OutputVar2=%LocalVar2%
SET OutputVar3=%LocalVar3%
)
In this case, the contents of the %LocalVarn% variables, which would be cleared by the
ENDLOCAL are "transferred" to the parent environment (the one that was active before
SETLOCAL) as %OutputVarn%.
|