Exporteren (0) Afdrukken
Alles uitvouwen

Endlocal

Bijgewerkt: september 2007

Van toepassing op: 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

endlocal

Parameters

 

Parameter Description

/?

Displays help at the command prompt.

Remarks

  • The endlocal command has no effect outside a script or batch file.

  • There is an implicit endlocal command at the end of a batch file.

  • If command extensions are enabled (command extensions are enabled by default), the endlocal command restores the state of command extensions (that is, enabled or disabled) to what it was before the corresponding setlocal command was run.

noteNote
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:

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

Additional references

Vindt u dit nuttig?
(1500 tekens resterend)
Bedankt voor uw feedback

Community-inhoud

Weergeven:
© 2014 Microsoft