Juri Strumpflohner
Juri Strumpflohner Juri is a full stack developer and tech lead with a special passion for the web and frontend development. He creates online videos for Egghead.io, writes articles on his blog and for tech magazines, speaks at conferences and holds training workshops.

HowTo: execute a file download from Windows command line

1 min read

Under Linux it is often very comfortable to download files quickly from within the shell by typing wget [some URL], especially if you do that from within a script. Under Windows this is not directly possible since there doesn't exist a wget-like program (at least I didn't find one). I guess if you install cygwin, then it may be possible to use wget again, I'd have to check that. Anyway, if you don't want to install cygwin and you have installed ServicePack2 (Win XP), then there is an application called "BitsAdmin" which allows you do to a similar job. The application usually comes under the Support Tools of the ServicePack 2.
Usage:
<installLocation>\bitsadmin.exe /transfer <jobName> /download /priority normal <url to file to download> <path where downloaded file should be stored>
So an example could look as follows:
C:\SupportTools\bitsadmin.exe /transfer chromiumUpdate /download /priority normal http://build.chromium.org/buildbot/continuous/LATEST/chrome-win32.zip C:\chromium\chomiumLatest.zip
This downloads a zip-file containing the latest Chromium build (What's the difference between Chromium and Chrome?).

References:
http://msdn.microsoft.com/en-us/library/aa362813.aspx
http://msdn.microsoft.com/en-us/library/aa362812(VS.85).aspx
Questions? Thoughts? Hit me up on Twitter
comments powered by Disqus