打开并等待 IE 在批处理文件中关闭 [英] Open and Wait untill IE is closed in batch file

查看:30
本文介绍了打开并等待 IE 在批处理文件中关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从批处理文件中打开 IE 并等待它关闭,然后再转到批处理文件的下一行.这个怎么做?顺便说一句,iexplore 命令似乎在 Windows 7 命令行中不起作用.知道为什么吗?

I want to open IE from a batch file and wait untill it is closed before going to the next line of the batch file. How to do this? BTW iexplore command seems to be not working in Windows 7 command line. Any idea why?

谢谢...

推荐答案

就进程生命周期而言,浏览器很复杂,即使在选项卡出现之前,IE 可能会在一个进程中打开多个窗口.他们还经常使用 DDE 打开 url,这使得跟踪正确"过程变得困难.如果你想强制用户使用 IE(为什么不使用默认浏览器?)你可以使用 windows 脚本主机来自动化 IE(自动化在保护 IE IIRC 方面有一些问题)

Browsers are complicated when it comes to process lifetime, even back in the days before tabs, IE could have more than one window open in a single process. They also often use DDE to open urls making it hard to track the "correct" process. If you want to force the user to use IE (Why not use the default browser?) you could use windows scripting host to automate IE (Automation has some problems when it comes to protected IE IIRC)

我建议只是一个简单的暂停:

I would recommend just a simple pause:

start /wait http://example.com
echo. When you are done reading xyz, press [Enter] to continue...
pause >nul

这篇关于打开并等待 IE 在批处理文件中关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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