Windows 找不到指定的文件,而 运行 来自 .bat 文件的 exe

Windows cannot find the file specified while running an exe from .bat file

我正在尝试 运行 .bat 文件中的 exe 但是,每次我 运行 powershell 中的 .bat 文件时,它都会抛出上述错误。

在 cmd 和 powershell window 中,当我导航到文件夹内部然后 运行 exe 文件时,它工作正常。

我的 bat 文件如下所示。 final1.bat

START /w "H:\trunk-2017-10-16" Bootstrapper.exe

有什么我可能遗漏的吗?

假设你的可执行文件是"H:\trunk-2017-10-16\Bootstrapper.exe"

那么你需要

START /w "" "H:\trunk-2017-10-16\Bootstrapper.exe"

请注意,第一个引用的参数变为 window-title。

或者,如果您真的希望 "H:\trunk-2017-10-16" 成为您的 window-title,那么 bootstrapper.exe 目前似乎不在您的 path 上。