Hi,
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?
Thanks...
Hi,
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?
Thanks...
start /wait whatever.exe
The /wait
flag will make start wait until the program closes before it returns.
As for iexplore not working, you're right. That's curious... However, you can still invoke it with a full path:
start "" /wait "c:\Program Files\Internet Explorer\iexplore.exe" http://stackoverflow.com
I've updated the second command line to work around some manner of bug in start
's command processing. It's weird. However, the proper way to do this is:
start /wait http://address.com
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
call "C:\Program Files\Internet Explorer\iexplore.exe" www.google.com
call "C:\Program Files\Internet Explorer\iexplore.exe" www.stackoverflow.com
call "C:\Program Files\Internet Explorer\iexplore.exe" www.codeproject.com
echo done
pause
I tried it on windows 7 and it works perfectly....
test the code before posting ur comments.......