【发布时间】:2012-06-29 16:29:13
【问题描述】:
我知道,我知道。那就是疯狂所在。
标题指的是这个great answer。我只想一劳永逸地解决是否真的可以做这样的事情:
cmd /C start c:\program files (says "Windows cannot find c:\program)
cmd /C "start c:\program files" (ditto)
cmd /C start "c:\program files" (opens another command window)
cmd /C start \"c:\program files\" (says "Windows cannot find \"c:\program files\")
cmd /C "start \"c:\program files\"" (ditto)
cmd /C "start ^"c:\program files^"" (opens another command window)
rem Ad nauseam.
我要做的就是启动一个名称中可能包含空格的文件夹或 url。这是“高级”吗?
我见过this question,但是\"在上面不起作用。
我从 VFP 中的 WScript.Shell 对象调用它,因此我必须将整个命令作为单个字符串传递。但我想解决更一般的问题以供参考。
【问题讨论】:
-
我以前打过这场仗,并决定将这些东西放入(可能是临时的)文件并将其作为输入通过管道输入总是更容易且不易出错,即使它涉及 scp /rsync-ing 这些文件到其他地方。
-
@JasonD,谢谢,我已经考虑过了(或环境变量)。很高兴知道这对其他人来说并不太疯狂,因为我最终可能会走那条路。