CmdID

CmdID / Commands

setlocal

Starts localization of environment variables in a batch file. Windows commands reference

On Windows

Opens CmdID with your command. It is read in your browser and sent nowhere.

Windows

from the Windows commands reference, CC BY 4.0

Starts localization of environment variables in a batch file. Localization continues until a matching endlocal command is encountered or the end of the batch file is reached.

setlocal [enableextensions | disableextensions] [enabledelayedexpansion | disabledelayedexpansion]
verify other 2>nul
setlocal enableextensions
if errorlevel 1 echo Unable to enable extensions

To localize environment variables in a batch file, follow this sample script

rem *Begin Comment rem This program starts the superapp batch program on the network, rem directs the output to a file, and displays the file rem in Notepad. rem *End Comment @echo off setlocal path=g:\programs\superapp;%path% call superapp>c:\superapp.out endlocal start notepad c:\superapp.outIdentify
enableextensionsEnables the command extensions until the matching endlocal command is encountered, regardless of the setting before the setlocal command was run.
disableextensionsDisables the command extensions until the matching endlocal command is encountered, regardless of the setting before the setlocal command was run.
enabledelayedexpansionEnables the delayed environment variable expansion until the matching endlocal command is encountered, regardless of the setting before the setlocal command was run.
disabledelayedexpansionDisables the delayed environment variable expansion until the matching endlocal command is encountered, regardless of the setting before the setlocal command was run.
/?Displays help at the command prompt.