CALL指令主场迎战同/ WAIT选项启动 [英] CALL command vs. START with /WAIT option

查看:246
本文介绍了CALL指令主场迎战同/ WAIT选项启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是如何用WAIT选项START命令

How is the START command with a WAIT option

START /wait notepad.exe 
START /wait  notepad.exe 

...从使用CALL命令有什么不同?

...any different from using a CALL command?

CALL notepad.exe 
CALL notepad.exe 

是否有一个情况,其中一个行为可能不同,关于正在执行什么其他dependending?

Is there a situation where one may behave differently that the other dependending on what is being executed?

推荐答案

有关exe文件,我想的差异几乎是不重要的。结果
但启动一个exe文件,你甚至不需要呼叫。

For exe files, I suppose the differences are nearly unimportant.
But to start an exe you don't even need CALL.

在启动另一批这是一个很大的区别,结果
呼叫将在同一窗口中启动它和被叫一批具有访问相同的变量范围内。结果
所以它也可以改变从而影响呼叫者变量。

When starting another batch it's a big difference,
as CALL will start it in the same window and the called batch has access to the same variable context.
So it can also change variables which affects the caller.

开始将创建称为批处理和无/ B将打开一个新的窗口,一个新的CMD.EXE。结果
由于这是一个新的上下文,变量不能共享。

START will create a new cmd.exe for the called batch and without /b it will open a new window.
As it's a new context, variables can't be shared.

附录:结果
使用呼叫可以改变参数(批量和EXE文件),但只有当它们包含插入符号或百分号。

Addendum:
Using CALL can change the parameters (for batch and exe files), but only when they contain carets or percent signs.

call myProg param1 param^^2 "param^3" %%path%%

将扩大(从批处理文件)

Will be expanded to (from within an batch file)

myProg param1 param2 param^^3 <content of path>

这篇关于CALL指令主场迎战同/ WAIT选项启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆