Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I download something from the web directly without Internet Explorer or Firefox opening Acrobat Reader/Quicktime/MS Word/whatever?

I'm using Windows, so a Windows version of Wget would do.

share|improve this question
7  
The point of having a command is being able to write a batch file and run it (perhaps scheduled as a task) anytime you want. That's where the GUI falls short. –  Jbm Nov 15 '12 at 14:11

17 Answers 17

up vote 85 down vote accepted

Wget for Windows should work.

GNU Wget is a free network utility to retrieve files from the World Wide Web using HTTP and FTP, the two most widely used Internet protocols. It works non-interactively, thus enabling work in the background, after having logged off

.

share|improve this answer
6  
There's also Winwget cybershade.us/winwget if you prefer a gui –  Col Aug 19 '09 at 11:47
7  
The standalone version is downloadable from this link. –  VitoShadow Feb 24 at 11:19

An alternative I discovered recently, using PowerShell:

$client = new-object System.Net.WebClient
$client.DownloadFile("http://www.xyz.net/file.txt","C:\tmp\file.txt")

It works as well with GET queries.

If you need to specify credentials to download the file, add the following line in between:

$client.Credentials =  Get-Credential                

A standard windows credentials prompt will pop up. The credentials you enter there will be used to download the file. You only need to do this once for all the time you will be using the $client object.

share|improve this answer
34  
You can also do it in one-line: (new-object System.Net.WebClient).DownloadFile('http://www.xyz.net/file.txt','C:\tmp\file.tx‌​t') –  schellack Oct 14 '11 at 20:32
9  
@Rob powershell is built in to Windows... –  nhinkle Dec 14 '12 at 4:22
5  
From Vista up, yes. –  Arran Dec 19 '12 at 12:44
3  
I wish I could favourite this answer! –  mjbnz Apr 9 '13 at 4:18
10  
@Arran Okay, for the people with systems that are morbidly out of date (Microsoft ended mainstream support for Windows XP in April 2009, [more than four years ago], and is ending extended support in April 2014 [less than one year from now]), for those users, yes, it's not built-in; they will have to download PowerShell separately (which is still easier to download and setup than any of the GNU toolchains out there) -- but honestly, figuring out how to download a file from the command line should be the least of such a person's computer-related worries... –  BrainSlugs83 Jun 4 '13 at 21:09

Save the following text as wget.js and simply call

cscript /nologo wget.js http://example.com

This is the code:

var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
WinHttpReq.Open("GET", WScript.Arguments(0), /*async=*/false);
WinHttpReq.Send();
WScript.Echo(WinHttpReq.ResponseText);

/* To save a binary file use this code instead of previous line
BinStream = new ActiveXObject("ADODB.Stream");
BinStream.Type = 1;
BinStream.Open();
BinStream.Write(WinHttpReq.ResponseBody);
BinStream.SaveToFile("out.bin");
*/
share|improve this answer
2  
Thank you, that's exactly what I needed ! –  Isaac Clarke May 22 '13 at 6:57

Windows has its own command line download utility - BITSAdmin:

BITSAdmin is a command-line tool that you can use to create download or upload jobs and monitor their progress.

share|improve this answer
4  
Interesting. That is one clumsy piece of software compared to wget. –  Matt H Mar 28 '12 at 21:36
1  
Note that It doesn't ship with Windows XP, and maybe not with other versions either. –  Ian Dunn May 22 '12 at 23:06
3  
Update: BITSAdmin is deprecated and is not guaranteed to be available in future versions of Windows. Administrative tools for the BITS service are now provided by BITS PowerShell cmdlets. –  nulldev07 Sep 28 '12 at 5:49

I made a quick myGet.bat file which calls the powershell method described above.

@Echo OFF
SetLocal EnableDelayedExpansion
Set Var=%1
Set Var=!Var:http://=!
Set Var=!Var:/=,!
Set Var=!Var:%%20=?!
Set Var=!Var: =?!
Call :LOOP !var!
Echo.Downloading: %1 to %~p0!FN!
powershell.exe -Command (new-object System.Net.WebClient).DownloadFile('%1','%~p0!FN!')
GoTo :EOF
:LOOP
If "%1"=="" GoTo :EOF
Set FN=%1
Set FN=!FN:?= !
Shift
GoTo :LOOP

I borrowed some code from here: http://www.computing.net/answers/programming/parsing-url-for-filename-with-space/14749.html

share|improve this answer
1  
why the downvote? this looks okay to me and is a direct response to the question. Yes it's clunky and could use improvement, like escaping ampersands (&) in the url, but it works as is. –  matt wilkie Apr 24 '13 at 5:02

There is also a native cURL for Windows available here. There are many flavors available- with SSL support, without SSL support. You don't need the extra baggage of cygwin and the likes, just one small exe file.

share|improve this answer

If you have PowerShell >= 3.0, you can use Invoke-WebRequest

Invoke-WebRequest http://superuser.com -OutFile index.html

Or golfed

wget http://superuser.com -outf index.html

Download a file via HTTP in Windows

share|improve this answer
2  
IMHO The best answer for recent Windows. –  Cédric Belin May 31 at 6:12

And one more for completeness, Cygwin has wget (and many more utilities).

share|improve this answer

I know I am really late. I was searching for the same, and since I had no privilege to install any of the above packages, I went for a small workaround (to download 30+files)

  • I created a batch file
  • listed all the files
  • put firefox.exe at the beginning of each line
  • went to the firefox directory in Program Files
  • ran it.
share|improve this answer

You can get WGet for Windows here. Alternatively you can right click on the download link of the item you want to download and choose Save As. This will download the file and not open it in the assigned application.

share|improve this answer

And http://www.httrack.com/ has a nice gui (and it's free), for mirroring sites. Also has a Linux version.

share|improve this answer

If PowerShell is an option, that's the preferred route, since you (potentially) won't have to install anything extra:

(new-object System.Net.WebClient).DownloadFile('http://www.xyz.net/file.txt','C:\tmp\file.tx‌​t')

Failing that, wget for windows, as others have pointed out is definitely the second best option. As posted above it looks like you can download wget all by itself, or you can grab it as a part of Cygwin or MSys

If for some reason, you find yourself stuck in a time warp, using a machine that doesn't have PowerShell and you have zero access to a working web browser (i.e. IE is the only browser on the system, and its settings are corrupt), and your file is on an FTP site (as opposed to HTTP):

start->run "FTP", press "OK".

If memory serves it's been there since Windows 98, and I can confirm that it is still there in Windows 8 RTM (you might have to go into appwiz.cpl and add/remove features to get it). This utility can both download and upload files to/from FTP sites on the web. It can also be used in scripts to automate either operation.

This tool being built-in has been a real life saver for me in the past, esp. in the days of ftp.cdrom.com -- downloaded Firefox that way once, on a completely broken machine that had only dial-up internet (back when sneaker-net's maximum packet size was still 1.44 MB, and Firefox was still called "Netscape" /me does trollface).

Couple of tips, it's its own command processor, and it has its own syntax, try typing "help". All ftp sites require a username and password; but if they allow "anonymous" users, the username is "anonymous" and the password is your email address (you can make one up if you don't want to be tracked, but usually there is some kind of logic to make sure it's a valid email address).

share|improve this answer

For my unreliable mobile broadband connection, I found http://burnbit.com/ useful.

It turns a URL into a torrent.

share|improve this answer

If you want a GUI, then try VisualWget, which is actually clean, and feature full. It is based on GNU Wget for its download engine.

EDIT: updated link.

share|improve this answer
1  
here is an updated link: sites.google.com/site/visualwget/… (the downloads are at the bottom of the page, use the little arrows on the right) –  Reed Hedges May 13 '12 at 12:43

I have an extension installed in my browser for selective media and link downloads on webpages: DownThemAll.

Quickly setting a filter for pdf and a target d/l directory, I was able to grab like 50 .pdf doc's linked on a webpage. Walla. Fastest, no install, and the beauty of wget (already in my path in c:\bin) was tarnished by not remembering or being able to figure out a good command line to grab all the pdf's linked from a web page...should worked! /..

share|improve this answer

Because I did not want to install anything (cygwin, msysgit) besides the stuff already installed (.NET 4.0) I decided to create my own. If you'd like to take a look you can see what it does and how to use it here: http://acarrilho.com/global for the wget/curl like cli go to the bottom of the page. hope it's helpful

share|improve this answer

An alternative to using gnuwin32 is unxutils which includes wget.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.