shell – 如何在cmd start中使用引号?

这是我想做的事情.
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 – Start a program,command or batch script (opens in a new window.)

Syntax

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

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...