----^--->
/\

//\\
//The\
/Sy
stem\
////
Guard
\

In the mount of the LORD it shall be seen. Genesis 22:14

ENDLOCAL

Booming Or Fuming? | MasterCatalog | ntlib (FREE) | NTCmdLib | MtCmds | Scripts | Almost Free | TheGuardBook | Help

 

Common
Command Set
INTERNAL

  ASSOC | BREAK | CALL | CD | CHDIR | CLS | COLOR | COPY | DATE | DEL | DIR | ECHO | ENDLOCAL | ERASE | EXIT | FOR | FTYPE | GOTO | IF | MD | MEM | MKDIR | MOVE | PATH | PAUSE | POPD | PROMPT | PUSHD | RD | REM | REN | RENAME | RMDIR | SET | SETLOCAL | SHIFT | START | TIME | TITLE | TYPE | VER | VERIFY | VOL

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

ENDLOCAL

   

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%.


Common
Command Set
INTERNAL

  ASSOC | BREAK | CALL | CD | CHDIR | CLS | COLOR | COPY | DATE | DEL | DIR | ECHO | ENDLOCAL | ERASE | EXIT | FOR | FTYPE | GOTO | IF | MD | MEM | MKDIR | MOVE | PATH | PAUSE | POPD | PROMPT | PUSHD | RD | REM | REN | RENAME | RMDIR | SET | SETLOCAL | SHIFT | START | TIME | TITLE | TYPE | VER | VERIFY | VOL
/\
//\\
//
The\
/Sy
stem\
////
Guard
\
COME ON UP WITH US!
and
Congratulations On Your Decision
to
RISE ABOVE
THE REST!

^
/
!\
/LIB\

TheSystemGuard.com [Revised: 2007-03-29]
Copyright © 1995-2007, JWC
Computer Communications,
All Rights Reserved, Worldwide.
 Disclaimer       Privacy       About Us       More


Communication Is Business!

We Master It With Knowledge!

^
/
.\
/M^C\