結(jié)束批處理文件中環(huán)境更改的本地化,將環(huán)境變量還原為匹配 setlocal 命令前的值。
在批處理文件中可以本地化環(huán)境變量。例如:
@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
| 格式 | 含義 |
|---|---|
| 斜體 | 用戶必須提供的信息 |
| 粗體 | 用戶必須準(zhǔn)確鍵入的要顯示的元素 |
| 省略號(hào) (...) | 在命令行中可多次重復(fù)的參數(shù) |
| 中括號(hào) ([]) | 可選項(xiàng) |
| 大括號(hào) ({});選項(xiàng)用豎線 (|) 分隔。例如:{even|odd} | 用戶必須從選項(xiàng)集合中選擇一個(gè) |
Courier 字體 | 代碼或程序輸出 |