How do I get batch to click download

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
shaun.cell74
Posts: 2
Joined: 19 Jun 2011 15:31

How do I get batch to click download

#1 Post by shaun.cell74 » 19 Jun 2011 15:40

I am writing a small batch file to handle the innumerable amount of updates Adobe has each and every month.

I have written the batch file which will go to the website, wait for input (download button/exit), move to the next algorithym and repeat.

My problem is getting the batch file to click the stupid download button. How do I proceed? wget?

Code: Select all

@ECHO OFF
ECHO INSTALLING ADOBE FLASH PLAYER PLUGIN UPDATE
ECHO.
start /wait iexplore.exe http://get.adobe.com/flashplayer/
wget -r -l1 http//:get.adobe.com/flashplayer/download/
ECHO.
ECHO.
ECHO.
ECHO INSTALLING ADOBE READER PLUGIN UPDATE
ECHO.
start /wait iexplore.exe http://get.adobe.com/reader/download/
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO INSTALLING ADOBE SHOCKWAVE PLUGIN UPDATE
ECHO.
start /wait iexplore.exe http://get.adobe.com/shockwave/thankyou/
ECHO.
ECHO.
taskkill /im iexplore.exe
ECHO.
ECHO.
ECHO.
ECHO COMPLETE!
EXIT

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Re: How do I get batch to click download

#2 Post by Cleptography » 19 Jun 2011 17:13

If you are going to use wget, you mine as well use autoit.

shaun.cell74
Posts: 2
Joined: 19 Jun 2011 15:31

Re: How do I get batch to click download

#3 Post by shaun.cell74 » 19 Jun 2011 19:05

Here is my problem, I am not very knowledgeable in these commands (autoit/wget).

What is the better of the two? Which is easier to implement? is the command part of the dos platform/windows or do I need to download a package? Is there a good api/man pages for these commands?

I would appreciate additional guidance.

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Re: How do I get batch to click download

#4 Post by Cleptography » 19 Jun 2011 20:14

For wget http://www.gnu.org/software/wget/manual/wget.html
For autoit the included help is all you need. You may as well want to do a search on their forums
You can also just do a google search "autoit to (do what you want to do)" which should give you some
good results / scripts.

As far as my personal opinion goes on what you are trying to accomplish, I would go with autoit.
It downloads pages a little faster, and has the capabilities of pressing buttons, filling in forms, etc...
Depending upon which browser you are using IE, Firefox, Opera, You might want to check out the UDF's
for Firefox, and Opera to allow more control over browser actions.
http://www.autoitscript.com/wiki/UDF

orange_batch
Expert
Posts: 442
Joined: 01 Aug 2010 17:13
Location: Canadian Pacific
Contact:

Re: How do I get batch to click download

#5 Post by orange_batch » 19 Jun 2011 20:49

If you need to download something, use wget. If you need to "click" something, you can use VBScript WshShell's SendKeys method to do keyboard input.

DOS:

Code: Select all

cscript keys.vbs //nologo

keys.vbs:

Code: Select all

set a=wscript.createobject("wscript.shell")
a.sendkeys "12345"

Google SendKeys for special buttons. For example, ENTER is {ENTER} or ~

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Re: How do I get batch to click download

#6 Post by Cleptography » 19 Jun 2011 21:51

orange_batch wrote:If you need to download something, use wget. If you need to "click" something, you can use VBScript WshShell's SendKeys method to do keyboard input.

Why would you tell them to use wget? It is much slower...
I would recommend wget if you plan on downloading and rendering entire pages, but for simple downloading of files autoit dominates in speed, and depending on the browser your vbscript method will fail sometimes. :roll:
I do not understand why the vbscript you could though with less could and (without having to open the browser)
Send form data and request. Epic fail

orange_batch
Expert
Posts: 442
Joined: 01 Aug 2010 17:13
Location: Canadian Pacific
Contact:

Re: How do I get batch to click download

#7 Post by orange_batch » 20 Jun 2011 05:41

Because AutoIt is a whole different language and everything, and this is a DOS batch forum. Being here in the first place, if a decent solution works, it's often good enough. Anyway that's your advice, this is my advice.

Cleptography
Posts: 287
Joined: 16 Mar 2011 19:17
Location: scriptingpros.com
Contact:

Re: How do I get batch to click download

#8 Post by Cleptography » 20 Jun 2011 06:14

Well if this is truly a "DOS" forum we should not be talking about batch scripts let alone vbscripts :wink:
I don't know what the hell wget is must be native on some version of windows I've never heard of.

Post Reply