"start%comspec%/ c script.cmd"vs"start cmd/C script.cmd"

Vol*_*lyy 10 windows cmd batch-file

以下命令有什么区别:

start %comspec% /c script.cmd
start cmd /C script.cmd
Run Code Online (Sandbox Code Playgroud)

我需要script.cmd的cmd窗口在script.cmd完成时自动关闭.

小智 15

%comspec%只指向cmd.exe,所以这两个命令都会做同样的事情.除此之外/C,这将在执行后关闭命令提示符