Solved

Script to AutoDownload a file from a webaddress

Posted on 2014-02-17
6
347 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
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 51

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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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 14

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now