Solved

Script to AutoDownload a file from a webaddress

Posted on 2014-02-17
6
358 Views
Last Modified: 2014-02-17
I have a file that I need downloaded from a website daily, I'd like to automate this with a script, to download and save to a particular location. Is there a .bat a can create to accomplish this?
0
Comment
Question by:Mcottuli
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39864632
0
 
LVL 12

Expert Comment

by:Chris
ID: 39864634
You could use wget for windows (http://gnuwin32.sourceforge.net/packages/wget.htm). This is a command line utility so you could write a bat file to run it.

Alternatively you could look at powershell to perform the download (http://answers.oreilly.com/topic/2006-how-to-download-a-file-from-the-internet-with-windows-powershell/).
0
 
LVL 54

Expert Comment

by:Bill Prew
ID: 39864679
As mentioned above, WGET is often the tool of choice in BAT scripts for pulling web pages and content.

Right behind it I would say is a similar tool called CURL, located at:

http://curl.haxx.se/

You can also do this in VBS natively, for example:

http://www.robvanderwoude.com/vbstech_internet_download.php

~bp
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 16

Expert Comment

by:gurutc
ID: 39864838
I recommend CURL.  It has more options.

- gurutc
0
 
LVL 1

Author Closing Comment

by:Mcottuli
ID: 39864904
Thank you. Works great
0
 
LVL 15

Expert Comment

by:Giovanni Heward
ID: 39864938
Both Wget and cURL will get the job done-- however, if you're looking for a native Windows solution (no third party software required), check this out:

Download file
:download
powershell -ep bypass -c "(New-Object System.Net.WebClient).Downloadfile('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip','top-1m.csv.zip')"
goto :eof

Open in new window


Extract ZIP file
:extract
powershell -ep bypass -c "$zipPackage=(New-Object -com shell.application).NameSpace('top-1m.csv.zip');$destinationFolder=(new-object -com shell.application).NameSpace('%~dp0');$destinationFolder.CopyHere($zipPackage.Items(),0x14)"
goto :eof

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question