Solved

Script to AutoDownload a file from a webaddress

Posted on 2014-02-17
6
361 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 55

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article discusses how to create an extensible mechanism for linked drop downs.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

690 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