CALL SET FOR

CALL 帮助文档 写道
Calls one batch program from another. #调用其他地方的一段batch程序

CALL [drive:][path]filename [batch-parameters] #<==命令使用格式

batch-parameters Specifies any command-line information required by the
batch program. #指定batch程度需要的命令行信息。

If Command Extensions are enabled CALL changes as follows:

CALL command now accepts labels as the target of the CALL. The syntax
is:
#Call命令接受字符串作为Call的目标。语法如下:

CALL :label arguments

A new batch file context is created with the specified arguments and
control is passed to the statement after the label specified. You must
"exit" twice by reaching the end of the batch script file twice. The
first time you read the end, control will return to just after the CALL
statement. The second time will exit the batch script. Type GOTO /?
for a description of the GOTO :EOF extension that will allow you to
"return" from a batch script.

#一个新的内容包含指定参数batch文件被创建,控制权is passed到指定文本的语句。你必须
“退出” 2次才到达batch脚本文件2次。第一次,你读到文件的末尾,控制权会转移到call后面的语句。
第一次会退出batch脚本。 Type GOTO /? 查看GOTO的描述 :EOF 拓展会运行你从一个batch脚本中
返回。

In addition, expansion of batch script argument references (%0, %1,
etc.) have been changed as follows:
另外,拓展的batch脚本参数引用已经改变如下:


%* in a batch script refers to all the arguments (e.g. %1 %2 %3
%4 %5 ...)

Substitution of batch parameters (%n) has been enhanced. You can
now use the following optional syntax:

%~1 - expands %1 removing any surrounding quotes (") #删除引号
%~f1 - expands %1 to a fully qualified path name #扩充到路径
%~d1 - expands %1 to a drive letter only #扩充到 盘符
%~p1 - expands %1 to a path only #扩充到 路径
%~n1 - expands %1 to a file name only #扩充到 文件名
%~x1 - expands %1 to a file extension only #扩充到 文件拓展类型
%~s1 - expanded path contains short names only #扩充到 路径包含的文件名
%~a1 - expands %1 to file attributes # 文件属性
%~t1 - expands %1 to date/time of file # 文件时间
%~z1 - expands %1 to size of file #文件大小
%~$PATH:1 - searches the directories listed in the PATH
environment variable and expands %1 to the fully
qualified name of the first one found. If the
environment variable name is not defined or the
file is not found by the search, then this
modifier expands to the empty string

#查找文件目录列表在指定的PATH环境变量参数和拓展到第一次发现的【修饰名】。
如果环境变量名没有定义或者文件没有被搜索到,这个修改就会拓展成空字符串。

The modifiers can be combined to get compound results:
#修改可以被联合使用得到复合的结果。

%~dp1 - expands %1 to a drive letter and path only
%~nx1 - expands %1 to a file name and extension only
%~dp$PATH:1 - searches the directories listed in the PATH
environment variable for %1 and expands to the
drive letter and path of the first one found. #在环境变量中查找具有盘符和路径的文件夹列表
%~ftza1 - expands %1 to a DIR like output line

In the above examples %1 and PATH can be replaced by other
valid values. The %~ syntax is terminated by a valid argument
number. The %~ modifiers may not be used with %*
#在上面的例子中,%1 和 PATH可以用其他有效的值来代替。
%~ 语法 是以一个有效的数值参数结尾的。
%~修饰语不能使用%*

 

你可能感兴趣的:(call)