12
1
I'm trying to run Internet Explorer from a batch file/scheduled task.
My batch file contains (in its entirety):
cd "%ProgramFiles%\Internet Explore"
iexplore.exe http://superuser.com -nohome
When I run the batch file the URL picks up the command line argument, rather than acting on it.
I'm sure I'm doing something silly, but don't see what at the moment. What is the solution?
This is on Windows 7 Home Premium, with Internet Explorer 8.
UPDATE in response to comments:
I got the nohome
from some site or other, possibly the one mentioned in the comments. The previous attempt was actually using nohangrecovery
which is documented Internet Explorer Command-Line Options.
My original attempt looked like this (which is actually as per the MSDN documentation:
cd "%ProgramFiles%\Internet Explore"
iexplore.exe -nohangrecovery http://superuser.com
This results in the address bar containing:
Sorry if this is a duplicate - I couldn't see any matches when I searched.
http://msdn.microsoft.com/en-us/library/ee330728%28v=vs.85%29.aspx No longer valid. – Andrew Truckle – 2019-04-25T04:42:18.060
@AndrewTruckle: Taa updated. – Jon Egerton – 2019-04-29T14:54:58.890
1Is it possible that \Internet Explore is a typo? Isn't it Internet Explorer? – n0pe – 2011-07-04T13:18:19.387
That's a good point - well spotted. Its workng anyway, probably cos the bat file is in the Internet Explorer folder and I'm just clicking on it at the moment. – Jon Egerton – 2011-07-04T13:22:24.747
1It might be because iexplore.exe is in the PATH which means that even if you're 'cd' ing to another directory, Windows is still finding the exe in the PATH. – n0pe – 2011-07-04T13:42:16.110