Computer Hope

Software => Internet browsers => Topic started by: s_r on March 08, 2012, 05:53:46 AM

Title: how can I open a URL file (Internet Shortcut) using iexplore.exe and a parameter
Post by: s_r on March 08, 2012, 05:53:46 AM
If I try giving the file's name as a parameter, internet explorer uses the file-name as url, instead of the url itself.
Double-clicking the URL file or dragging it to an existing window works, but I need to do it from a program, without using the cmd (or the start cmd)

Thanks
Title: Re: how can I open a URL file (Internet Shortcut) using iexplore.exe and a parameter
Post by: soybean on March 08, 2012, 10:00:16 AM
I can't make any sense of your post.  Internet explorer is a web browser; you use it to view websites.  You know that, right?  ::)  It is not a program used to open "files" on your computer.  So, your comments about " giving the file's name as a parameter" make no sense whatsoever in relation to using a web browser.
Title: Re: how can I open a URL file (Internet Shortcut) using iexplore.exe and a parameter
Post by: Salmon Trout on March 08, 2012, 10:49:57 AM
I need to do it from a program, without using the cmd (or the start cmd)

Why?

Title: Re: how can I open a URL file (Internet Shortcut) using iexplore.exe and a parameter
Post by: Salmon Trout on March 08, 2012, 11:27:37 AM
I can't make any sense of your post.  Internet explorer is a web browser; you use it to view websites.  You know that, right?  ::)  It is not a program used to open "files" on your computer.  So, your comments about " giving the file's name as a parameter" make no sense whatsoever in relation to using a web browser.

He's asking about internet shortcuts; these are text files that follow the standard .ini file format. They have the extension .url Here are a couple of examples

Code: [Select]
[InternetShortcut]
URL=http://mpc-hc.sourceforge.net/

Code: [Select]
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://go.microsoft.com/fwlink/?LinkId=54729
IDList=

It's simple enough to parse out the line that starts URL= but I want to know why the OP is specifying this

Code: [Select]
I need to do it from a program, without using the cmd (or the start cmd)


Title: Re: how can I open a URL file (Internet Shortcut) using iexplore.exe and a parameter
Post by: BC_Programmer on March 08, 2012, 11:33:38 AM
couldn't one use the start command to do this as well by invoking the default verb on the url file?
Title: Re: how can I open a URL file (Internet Shortcut) using iexplore.exe and a parameter
Post by: Salmon Trout on March 08, 2012, 11:42:33 AM
couldn't one use the start command to do this as well by invoking the default verb on the url file?

That would invoke the default browser; he says in his subject line he wants to run iexplore.exe, (why?) and he says he wants to do it "from a program" (why?)...

Quote
without using the cmd (or the start cmd)
Title: Re: how can I open a URL file (Internet Shortcut) using iexplore.exe and a parameter
Post by: s_r on March 08, 2012, 12:42:51 PM
Hi,

First of all, it's a she.
And to answer your questions:
Not using the cmd is part of the requirements, and the reasons are complicated, so I'll leave it for now.
That would invoke the default browser; he says in his subject line he wants to run iexplore.exe, (why?) and he says he wants to do it "from a program" (why?)...

I need to do it automatically in a special case, and writing a batch file or a python script to do it will force me changing the design.

In the meantime  I found out that giving the url file with full path works just fine - if I give only the filename, it treats it as a url.

Thanks
Title: Re: how can I open a URL file (Internet Shortcut) using iexplore.exe and a parameter
Post by: Raptor on March 09, 2012, 03:49:08 AM
So you want to open a webpage from a command line?

firefox.exe -new-tab computerhope.com

Works for me. Just point it to the Firefox directory first.