结束批处理文件中环境更改的本地化,将环境变量还原为匹配 setlocal 命令前的值。
在批处理文件中可以本地化环境变量。例如:
@echo off
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.
setlocal
path=g:\programs\superapp;%path%
call superapp>c:\superapp.out
endlocal
start notepad c:\superapp.out
格式 | 含义 |
---|---|
斜体 | 用户必须提供的信息 |
粗体 | 用户必须准确键入的要显示的元素 |
省略号 (...) | 在命令行中可多次重复的参数 |
中括号 ([]) | 可选项 |
大括号 ({});选项用竖线 (|) 分隔。例如:{even|odd} | 用户必须从选项集合中选择一个 |
Courier 字体 | 代码或程序输出 |