Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 如何在相对路径中使用空格启动程序?_Batch File_Relative Path_Subdirectory - Fatal编程技术网

Batch file 如何在相对路径中使用空格启动程序?

Batch file 如何在相对路径中使用空格启动程序?,batch-file,relative-path,subdirectory,Batch File,Relative Path,Subdirectory,我正在尝试使用相对路径调用VBS文件。 例如,我们将文件命名为Something.vbs。 该文件位于一个带有空格的文件夹中,例如D:\folder\folder with a space\。 我使用以下代码 start %~dp0Something.VBS Bu我收到一个错误,指出文件夹D:\folder\folder不存在 我试着用这个函数来处理相对路径操作符 start "%~dp0"Something.VBS 及 但最终只会得到一个重置文件路径的提示 任何帮助或建议都将不胜感激。试试

我正在尝试使用相对路径调用VBS文件。 例如,我们将文件命名为Something.vbs。 该文件位于一个带有空格的文件夹中,例如D:\folder\folder with a space\。 我使用以下代码

start %~dp0Something.VBS
Bu我收到一个错误,指出文件夹D:\folder\folder不存在

我试着用这个函数来处理相对路径操作符

start "%~dp0"Something.VBS

但最终只会得到一个重置文件路径的提示

任何帮助或建议都将不胜感激。

试试看

start "This is the window title" "%~dp0Something.VBS"

start
有一个怪癖-引用的名称被假定为窗口标题。

准确地说:
start
之后命令行中第一个引用的字符串被假定为窗口标题。只要传递
就足够了。
start "This is the window title" "%~dp0Something.VBS"