如何转义路径名中的空格 - Windows 脚本
How to escape blanks in path name - Windows Scripting
我正在尝试 运行 下面的脚本。第一个程序启动得很好,但第二个程序在路径名中有空格时却没有。如何解决?谢谢。
Set Shell = WScript.CreateObject("WScript.Shell")
Shell.Run "cmd /n,C:\Windows\System32\", 4, False
Shell.Run "sublime_text /n,C:\Program Files\Sublime Text 3\", 4, False
按照下面的 link 解决了这个问题。我用 3 个双引号重写了最后一个语句。
How to call Run() with parameters
Set Shell = WScript.CreateObject("WScript.Shell")
Shell.Run "cmd /n,C:\Windows\System32\", 4, False
Shell.Run """C:\Program Files\Sublime Text 3\sublime_text.exe""", 4, False
我正在尝试 运行 下面的脚本。第一个程序启动得很好,但第二个程序在路径名中有空格时却没有。如何解决?谢谢。
Set Shell = WScript.CreateObject("WScript.Shell")
Shell.Run "cmd /n,C:\Windows\System32\", 4, False
Shell.Run "sublime_text /n,C:\Program Files\Sublime Text 3\", 4, False
按照下面的 link 解决了这个问题。我用 3 个双引号重写了最后一个语句。
How to call Run() with parameters
Set Shell = WScript.CreateObject("WScript.Shell")
Shell.Run "cmd /n,C:\Windows\System32\", 4, False
Shell.Run """C:\Program Files\Sublime Text 3\sublime_text.exe""", 4, False