Solved

Script to AutoDownload a file from a webaddress

Posted on 2014-02-17
6
355 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 53

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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 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)

808 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