I Have a batch file which has to launch Internet explorer and open www.google.com. When the whole page loads finishing it should kill the IE process i.e. close all instances of IE in that system. My batch file has following two lines.
iexplore.exe "www.google.com"
taskkill /IM iexplore.exe /F
But after loading it is not closing the IE instance.
If I am having seperate batch file with with only single line taskkill /IM iexplore.exe /F. This batch file closes the IE instance.
What is going wrong in First Batch file.
P.S Batch file is in Internet Explorer folder of program files.
I don't understand exactly your aim to open and to close immediately Internet explorer ? but here is an example with a sleep to show you how it does work !
And if you want to see more features like how to start a process and how to kill one process or multiple processes at once that interact with user input with a dynamic menu you should take a look at this post ==> How to check and correct user input when he omit the extension .exe to kill the process?
Try this alternative without confirmation from the user input :