Esporta (0) Stampa
Espandi tutto
Arp
At
Cd
Cls
Cmd
Del
Dir
Fc
For
Ftp
If
Ldp
Lpq
Lpr
Md
Mmc
Msg
Nlb
Rcp
Rd
Reg
Rem
Ren
Rsh
Rsm
Rss
Sc
Set
Sfc
Ver
Vol
Espandi Riduci a icona

Endlocal

Aggiornamento: settembre 2007

Si applica a: 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.

noteNota
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

Il documento è risultato utile?
(1500 caratteri rimanenti)
Grazie per i commenti inviati.

Aggiunte alla community

AGGIUNGI
Mostra:
© 2014 Microsoft