|
|
|
date: Fri, 2 Dec 2005 09:19:02 -0800,
group: microsoft.public.inetsdk.programming.scripting.jscript
back
Re: Passing a search string to IE from the command line
Larry wrote:
> I'm really not sure what news group is most appropriate for my
> question so here goes:
>
> Is there a way to pass a search string to IE when invoking IE from the
> command line? (Or rather, when launching IE from within another app
> with, eg, ShellExecute())
>
> By search string, I'm referring to the substring following the "?" in
> a URL. eg, http://www/my/web/site.htm?arg1=foo&arg2=bar. I want to
> be able to pass arguments to an html page directly from my (C++)
> application.
>
> I've tried escaping the ?, tried putting everything in quotes but IE
> (at least IE 6) seems not to interpret the "?" correctly when it
> comes from the command line. Is there some trick to doing this?
>
> Thanks!
Don't escape the ?. Just pass the string as it would be entered in the
address bar.
Try this:
Start | Run
Paste http://support.microsoft.com/default.aspx?scid=kb;EN-US;q305053 into
the dialog and press OK
I'm not a C++ guy, so you might get better support in a C++ newsgroup, but
try this script in a test.js file:
WshShell = WScript.CreateObject("WScript.Shell");
WshShell.Run("http://support.microsoft.com/default.aspx?scid=kb;EN-US;q30505
3")
WScript.quit();
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
date: Fri, 2 Dec 2005 13:47:25 -0500
author: Bob Barrows [MVP] com
Re: Passing a search string to IE from the command line
Ah, thank you, you've led me to a solution. My problem was that I was not
prefixing the URL of a local file + search string with "file://" which seems
to be necessary for correct interpretation of the search string when passing
the URL directly to IE, though not necessary when doing something like
window.location.href =...
within javascript.
"Bob Barrows [MVP]" wrote:
> Larry wrote:
> > I'm really not sure what news group is most appropriate for my
> > question so here goes:
> >
> > Is there a way to pass a search string to IE when invoking IE from the
> > command line? (Or rather, when launching IE from within another app
> > with, eg, ShellExecute())
> >
> > By search string, I'm referring to the substring following the "?" in
> > a URL. eg, http://www/my/web/site.htm?arg1=foo&arg2=bar. I want to
> > be able to pass arguments to an html page directly from my (C++)
> > application.
> >
> > I've tried escaping the ?, tried putting everything in quotes but IE
> > (at least IE 6) seems not to interpret the "?" correctly when it
> > comes from the command line. Is there some trick to doing this?
> >
> > Thanks!
> Don't escape the ?. Just pass the string as it would be entered in the
> address bar.
>
> Try this:
> Start | Run
> Paste http://support.microsoft.com/default.aspx?scid=kb;EN-US;q305053 into
> the dialog and press OK
>
> I'm not a C++ guy, so you might get better support in a C++ newsgroup, but
> try this script in a test.js file:
>
> WshShell = WScript.CreateObject("WScript.Shell");
> WshShell.Run("http://support.microsoft.com/default.aspx?scid=kb;EN-US;q30505
> 3")
> WScript.quit();
>
>
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
>
date: Fri, 2 Dec 2005 12:56:02 -0800
author: Larry
|
|