Internet Explorer commandline arguments

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.

http://superuser.com%20-nohome/

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:

http://-nohangrecovery%20http//superuser.com

Sorry if this is a duplicate - I couldn't see any matches when I searched.

Jon Egerton

Posted 2011-07-04T11:28:31.877

Reputation: 399

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

Answers

13

Please refer to the documentation for Internet Explorer command-line options. Command-line options should go before the URL, and -nohome is not even a supported option. Where did you learn about -nohome?

William Jackson

Posted 2011-07-04T11:28:31.877

Reputation: 7 646

Nohome is mentioned on this page referencing command line arguments. http://www.tek-tips.com/viewthread.cfm?qid=73898 It seems very outdated and this switch is possibly no longer supported as it is not referenced in newer material

– Joe Taylor – 2011-07-04T11:56:03.727

It's all right with William's solution! Since "iexplore" is a "known command" for Windows, you can start it everywhere using use "start iexplore -nohome http://www.bol.com.br/" (1 command line) instead of entering Internet Explorer folder and then executing that (2 command lines).

– kokbira – 2011-07-04T11:56:33.950

Fair comment about nohome. I had already tried other args and ordering. What I pasted into the question was based on other searches on google. See my update for more. – Jon Egerton – 2011-07-04T12:55:52.660

Curses - just noticed that the option I'm trying to use is IE9, not IE8. Guess that makes your re-pointer to the docu the answer!!! – Jon Egerton – 2011-07-04T13:10:42.827

2

Just use this command:

"%ProgramFiles%\Internet Explorer\iexplorer.exe" http://superuser.com

No need for the cd\

KCotreau

Posted 2011-07-04T11:28:31.877

Reputation: 24 985

Original: "%ProgramFiles%\Internet Explorer\iexploreR.exe" http://superuser.com (with extra "r" near the end of "iexplorer.exe" capitalized to show difference)

Fixed: Remove the "r" typo and you get: "%ProgramFiles%\Internet Explorer\iexplore.exe" http://superuser.com

Which can be copied and pasted and will work.

– Developer63 – 2019-05-23T18:20:46.330

0

Instead of cd and going to the directory you could just do:

start "" iexplore http://superuser.com  

or just:

start iexplore http://superuser.com  

-nohome should be put before the url. I'm not sure if the command exists.

learn_code

Posted 2011-07-04T11:28:31.877

Reputation: 1

0

If you're just trying to open up Super User every time you log in via a batch file then simply put in:

cd "%ProgramFiles%\Internet Explore"
iexplore.exe http://superuser.com

However, if you're doing this to log in for 100 days consecutively then this won't work. I won't tell you why, but it won't :-)

Joe Taylor

Posted 2011-07-04T11:28:31.877

Reputation: 11 533

lol - no I'm not. I'm mostly on StackOVerflow and I just lost a run of 29 consec days there by not paying attention on Sunday!!! The URL in the example is subbed in for the real one that I'm using. – Jon Egerton – 2011-07-04T12:54:44.500

1Ah ok, I lost a 94 day run by having a hungover Sunday, was gutted. If you just remove the -nohome parameter it should work fine. I've tested it here and its working ok. – Joe Taylor – 2011-07-04T14:13:10.803

-1

Add the -noframemerging switch at the end of the Internet Explorer shortcut and you will have separate sessions. This works in Windows 10 using Internet Explorer 11.

Norman Rothwell

Posted 2011-07-04T11:28:31.877

Reputation: 1