Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Script to AutoDownload a file from a webaddress

Posted on 2014-02-17
6
Medium Priority
?
373 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 2000 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 58

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
Independent Software Vendors: 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!

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

610 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