1.

Solve : Starting Internet Explorer using a DOS Batch file?

Answer»

Hi,

I've been tearing my hair out trying to solve this one. You can start IE from a DOS command easily using START http://www... etc

BUT

if you pass parameters such as

START http://www.facebook.com/photo.php?pid=848358&o=all&op=1&view=all&subj=10193807237&aid=-1&id=530366140&oid=10193807237#pid=848358&id=530366140

using the ampersand -- it discards the param values and pretends you want to run some kind of command. I've tried the usual superstitious advice people offer -- such as using quotes, single quotes, doube quotes, passing all the parameters as one quoted string, preceding each & with a %..

and so on.

Big reward to whoever solves this one!Normally the parser uses space as a delimiter. With no embedded space and unescaped characters that have meaning in batch files, the parser PROBABLY cannot make sense of the string.

You might try this:

Code: [Select]@echo off
"c:\program files\internet explorer\iexplore.exe" "http://www.facebook.com/photo.php?pid=848358&o=all&op=1&view=all&subj=10193807237&aid=-1&id=530366140&oid=10193807237#pid=848358&id=530366140"

I couldn't fully test this. Facebook kept redirecting me to the login screen.

PS. Sorry for the horizontal scroll. but there are only two lines in the code snippet.hey good one, i'll try it right now! rang ms support for the first time ever, and they said their server was down and couldn't log calls.

"oh.. how often does this HAPPEN?"

(heavy indian accent) "sir, it has never happened before."

D'oh!!you are a GENIUS! it worked perfectly!!!

where do I send the million quid to??!That really was pretty slick, thanks for that. Is there any kind of parameter I can give to DOS so that control returns to the DOS.exe I launch the batch file from, instead of waiting for them to finish with the explorer window? which may not be for the rest of the day?Quote

I've tried the usual superstitious advice people offer

From superstitious to slick. No too bad for a mornings work.

Code: [Select]@echo off
start "" "c:\program files\internet explorer\iexplore.exe" "http://www.facebook.com/photo.php?pid=848358&o=all&op=1&view=all&subj=10193807237&aid=-1&id=530366140&oid=10193807237#pid=848358&id=530366140"



How much is a quid worth in USD?hmm, about 1.9 something dollars but it's less and less as the day goes on!one other thing, they have a login screen on the website i'm trying to automate -- any idea how i can get the batch file to shove the login and password in there as it goes through into the explorer?

this project is bringing awkward new problems every time i get one thing solved..You can't with batch code. You've crossed over the line into WINDOWS Scripting.

Code: [Select]Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate "http://www.facebook.com/photo.php?pid=848358&o=all&op=1&view=all&subj=10193807237&aid=-1&id=530366140&oid=10193807237"

Do
WScript.Sleep 250
Loop Until Not objIE.Busy

objIE.Visible = True
Set theForm = objIE.Document.Forms(0)
With theForm
.email.Value = "[emailprotected]"
.pass.Value = "password"
.submit
End With

Change the email address and password. Save the script with a vbs extension. Run from the command prompt as cscript scriptname.vbs

PS. Please give all the information in your first REQUEST. It saves having these threads turn into marathons.

PSS. Every website is different. The code snippet is specific to facebook.That is very helpful, thanks. The reason I didn't mention those problems at first is because before, when the user was logged in, the new instances of ie took advantage of that. In this usage, they don't! So, new problem, and thanks for the answer.

This scripting seems very useful -- can you suggest any good books or webites which will help me develop it further? for example, to pull in XML as it's fed back from a site, that sort of thing?

Very grateful for this support!
A good site for learning script is The Scripting Guys

Check out the links on the page. It offers everything for beginners to experts including free downloads and the ever popular Scriptomatic.

You can also search for a help file on your system: script56.chm It's more of a reference than a primer but can be helpful for syntax.

Good luck.


Discussion

No Comment Found