Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.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
Windows 7 BAT文件-开始在某些Windows 7计算机上不随机工作_Windows 7_Path_Set_Startup - Fatal编程技术网

Windows 7 BAT文件-开始在某些Windows 7计算机上不随机工作

Windows 7 BAT文件-开始在某些Windows 7计算机上不随机工作,windows-7,path,set,startup,Windows 7,Path,Set,Startup,我有一个bat文件,用来启动GoogleChromePortable并在Kiok模式下打开网页 它在我的机器和其他3台机器上工作得很好,除了一台机器提醒我找不到.exe,即路径集不工作。代码如下: @echo off set path=%path%;"./folder/chromeFolder" START /b GoogleChromePortable.exe --kiosk "../../../../index.html" 我用usb传输这个。 存在../../../../../../..

我有一个bat文件,用来启动GoogleChromePortable并在Kiok模式下打开网页

它在我的机器和其他3台机器上工作得很好,除了一台机器提醒我找不到.exe,即路径集不工作。代码如下:

@echo off
set path=%path%;"./folder/chromeFolder"
START /b GoogleChromePortable.exe --kiosk "../../../../index.html"
我用usb传输这个。 存在../../../../../../../../index.html是因为chrome在文件夹结构的4层深处启动,即使GoogleChromePortable在chrome.exe上方3层(可能不相关)

在1*Windows8(工作)、1*Windows7(工作)、2*WindowsXP(工作)但1*Windows7(失败)上测试

错误消息: “Windows找不到GoogleChromePortable.exe请确保键入的地址正确”

我曾尝试在管理员模式下启动BAT,但仍然不起作用

我试着一步一步地输入这个,结果是

START GoogleChromePortable.exe
这是失败的


解决方案


对。修好了。不知道为什么会这样,所以如果有人知道我很想知道。我使用的不是上面的代码:

START %~dp0folder/chrome/GoogleChromePortable.exe --kiosk "../../../../index.html"
START %~dp0folder/chrome/GoogleChromePortable.exe --kiosk "../../../../index.html"
就这样。你知道为什么这种方法在一台机器上有效,而另一种方法在一台机器上无效吗?

“3高于它低于/strong>”-3高于什么

您似乎正在尝试将“.\folder\chromefolder”添加到路径中-也许可以添加位于“3”上方的目录,以便
GoogleChromePortable.exe
也位于路径上-可能位于您的USB上


也许Google ChromePortable.exe已经在其他机器上运行了…

对。修好了。不知道为什么会这样,所以如果有人知道我很想知道。我使用的不是上面的代码:

START %~dp0folder/chrome/GoogleChromePortable.exe --kiosk "../../../../index.html"
START %~dp0folder/chrome/GoogleChromePortable.exe --kiosk "../../../../index.html"

就这样。你知道为什么这在一台机器上有效而另一种方法在一台机器上无效吗?

ChromePortable.exe从第1级开始,向下调用chrome.exe 3层。我的index.html从整个文件夹上方的0级开始,要求命令cmd提示符向上看4级,如果index.html位于
“..\..\..\..\..\..\index.html”
,根据您的评论,
Chromeportable.exe
向下一层,然后在路径中包含
Chromeportable.exe
,这可能不是一个包含
“.\..\..\”
在路径中-或者甚至执行
“.\..\..\chromeportable.exe”
-或者
谷歌chromeportable.exe
或者它的名字是什么?不知道
chrome.exe
从哪里来的,但是从你所说的,也许它在
”\“
-如果相关的话,对不起,我知道这很难解释。这就是ChromePortable的工作原理。我想我已经找到了答案,但不知道它为什么工作。如果我使用START%-dp0folder/chrome/GoogleChromePortable.exe,它就可以工作。我很想知道为什么这个方法有效,为什么另一个方法在1台机器上无效文件夹结构如下:Run.bat、index.html、/folder/chrome/GoogleChromePortable.exe、/folder/chrome/folder/folder/chrome.exe