Command line options

  • Thread starter Thread starter John
  • Start date Start date
John,

Yes, you can. The easiest way to do this would be to send the URL to
the static Start method on the Process class. This will open the default
web browser for your machine. However, if you must use IE (say another
browser is set up as the default), then you can send a command line of
"iexplore.exe <url>" where <url> is the url of the site, and it should open
to that site.

Hope this helps.
 
System.Diagnostics.Process.Start(url);

This will pass the url to Windows and let it decide which program to call
(your default browser) but at least in case of Internet Explorer as the
default browser, it will use an already existing IE window if it finds
one, causing you it to be redirected from whatever page it currently holds.

or

System.Diagnostics.Process.Start("iexplore", url);

This will not work if the path to iexplore.exe isn't in the path
environment.
It will cause a new IE window to open.

or

System.Diagnostics.Process.Start(iepath, url);

Where iepath is the path to internet explorer. You should be able to
extract the path from the registry, somewhere.
 
I believe the path to Internet Explorer will always be found in

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\App Paths\IEXPLORE.EXE
 
Back
Top