Endlocal


Applies To: Windows Server 2008,Windows Vista

Ends localization of environment changes in a batch file, and restores environment variables to their values before the corresponding setlocal command was run.

For examples of how to use this command, see Examples.

Syntax


Copy Code

endlocal

Parameters

Parameter

Description

/?

Displays help at the command prompt.

Remarks

Note

For more information about enabling and disabling command extensions, see Cmd.

Examples

You can localize environment variables in a batch file. For example, the following program starts the superapp batch program on the network, directs the output to a file, and displays the file in Notepad:


Copy Code

@echo off
setlocal
path=g:\programs\superapp;%path%
call superapp>c:\superapp.out
endlocal
start notepad c:\superapp.out

Additional references

Command-Line Syntax Key