Open and Wait untill IE is closed in batch file

前端 未结 4 554
猫巷女王i
猫巷女王i 2020-12-04 00:57

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 workin

4条回答
  •  旧时难觅i
    2020-12-04 01:42

    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
    

提交回复
热议问题