.bat文件行为从命令行错误 [英] .bat file behaves wrong from command line

查看:277
本文介绍了.bat文件行为从命令行错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有只是打开了两个不同的浏览器,并将其指向的独特联系.bat文件。它开辟了第一个浏览器之后,它会等待几秒钟,然后打开第二个浏览器。我希望发生的是,第二个浏览器窗口会自动聚焦和积极。当我点击窗口中的图标蝙蝠这种行为才会发生。

I have a .bat file that simply opens up two different browsers and points them to unique links. After it opens up the first browser, it waits a few seconds, then opens up the second browser. What I expect to happen is that the second browser's window will automatically be focused and active. This behavior only happens when I click on the .bat icon in windows.

当我运行在命令行的.bat文件,第二个浏览器窗口打开,但会在后台。这的只有的情况发生在第一次浏览器是IE - 由于某种原因,它并不想放弃窗口焦点

When I run the .bat file from the command line, the second browser window opens, but in the background. This only happens when the first browser is IE - for some reason it doesn't want to relinquish window focus.

我已经使用类似/ MAX标志,以确保浏览器的重点是尝试,但并不在使窗口集中帮助。

I have tried using flags like /max to make sure the browser is focused but that doesn't help in bringing the window to focus.

没有任何人有什么想法?

Does anybody have any ideas?

下面是.bat文件:

@echo off
:: start IE
start iexplore  http://localhost:9080/tests/test_getLink.html
:: Wait ~3 seconds 
@ping 127.0.0.1 -n 4
:: start FF
start firefox -new-window http://localhost:9080/tests/containerTwoWayForm.html?robot=active

(IE浏览器页面民调中的链接服务器并处于等待状态的Firefox打开时,我想这可能有助于行为,但我不明白为什么它的命令行运行不同VS只需点击。 )

(the IE page polls the server for a link and is in a "waiting" state when firefox opens. I Thought this might contribute to the behavior but I don't understand why it runs differently from command line vs just clicking.)

我已经确定,只有IE浏览器作为第一个浏览器导致出现此问题。此外,它并不重要的第二个是浏览器(铬,即,几段)

I have made sure that only IE as the first browser causes this behavior. Also, it doesn't matter what browser the second on is (chrome, ie, ff.)

我也尝试创建第二个批处理文件来启动第二个浏览器,并从第一.BAT调用它,但是这并没有帮助。

I have also tried creating a second batch file to start the second browser and calling it from the first .bat, but that didn't help.

感谢您的任何提示

推荐答案

也许这是因为浏览器版本?您是否尝试过重新安装?
该脚本为我工作也赢XP SP3,IE7。

Maybe it's because of the explorer version? Have you tried reinstalling it? The script works for me also on Win XP SP3, IE7.

这篇关于.bat文件行为从命令行错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆