这是我想做的事情.
start /wait ((c:\Program Files\NetDrive2\nd2cmd.exe) -c m -t ftp -blabla)
如果我做
start /wait "c:\Program Files\NetDrive2\nd2cmd.exe -c m -t ftp -blabla"
然后出现错误,因为“Program Files”有空格.
如果我做
start /wait "c:\Program Files\NetDrive2\nd2cmd.exe" -c m -t ftp -blabla
无论如何在正常的程序语言中重叠像括号一样的等式?
参考
Start – Start a program,command or batch script (opens in a new window.)
原文链接:https://www.f2er.com/bash/383336.html
START "title" [/D path] [options] "command" [parameters]
Key:
title
Text for the CMD window title bar (required.)
path
Starting directory.
command
The command,batch file or executable program to run.
parameters
The parameters passed to the command.
…
Always include a TITLE this can be a simple string like “My Script” or just a pair of empty quotes “”. According to the Microsoft documentation,the title is optional,but you may will have problems if it is omitted.
如果省略title会出现错误的原因是因为第一个“字符(如果存在)将用于分隔标题,因此start会将”Program Files“解释为标题.
如果没有“字符,那么标题可以省略.
您的命令应如下所示:
start /wait "My title" "c:\Program Files\NetDrive2\nd2cmd.exe" -c m -t ftp -blabla