【问题标题】:Extra quotes for path with the spaces带有空格的路径的额外引号
【发布时间】:2016-06-17 12:39:26
【问题描述】:

我正在尝试从 Windows CMD 执行命令

cmd /c "timeout 3 > nul & start /min C:\Users\Me\Documents\Path with extra spaces\myapp.exe"

由于路径包含空格,我需要在其周围加上引号以指定正确的位置。到目前为止,我已经尝试了多种方法(额外的双引号“”,转义 ^),但没有一种方法有效。像这样:

cmd /c "timeout 3 > nul & start /min """C:\Users\Me\Documents\Path with extra spaces\myapp.exe""""

命令必须完全从 CMD 运行。

【问题讨论】:

标签: batch-file cmd


【解决方案1】:

start 将第一个引用的参数作为窗口标题。所以给它一个虚拟标题(例如一个空字符串""):

cmd /c "timeout 3 > nul & start "" /min "C:\Users\Me\Documents\Path with extra spaces\myapp.exe""

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-02-25
    • 1970-01-01
    • 2014-10-15
    • 2020-12-14
    • 1970-01-01
    • 1970-01-01
    • 2020-06-21
    • 1970-01-01
    相关资源
    最近更新 更多