加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

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

发布时间:2020-12-16 01:33:44 所属栏目:安全 来源:网络整理
导读:这是我想做的事情. start /wait ((c:Program FilesNetDrive2nd2cmd.exe) -c m -t ftp -blabla) 如果我做 start /wait "c:Program FilesNetDrive2nd2cmd.exe -c m -t ftp -blabla" 然后出现错误,因为“Program Files”有空格. 如果我做 start /wait "c:
这是我想做的事情.
start /wait ((c:Program FilesNetDrive2nd2cmd.exe) -c m -t ftp -blabla)

如果我做

start /wait "c:Program FilesNetDrive2nd2cmd.exe -c m -t ftp -blabla"

然后出现错误,因为“Program Files”有空格.

如果我做

start /wait "c:Program FilesNetDrive2nd2cmd.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 FilesNetDrive2nd2cmd.exe" -c m -t ftp -blabla

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读