Wget/cURL alternative native to Windows?

64

20

Is there a Wget or cURL type command line utility native to Windows Vista? How does it work?

Jordan

Posted 2011-06-20T19:22:54.703

Reputation: 641

1Using curl just for downloading things is like using vim just for the regex feature and then saying a question about vim is a duplicate to a question about regexes. Yes downloading data files is a huge part of HTTP but it's not its main purpose. – erikbwork – 2015-09-19T17:04:34.487

October 2017 with Windows 8.1: wget and curl are included in PowerShell, as shown here: https://stackoverflow.com/questions/33364752/equivalent-of-wget-command-line-for-windows-8-1/46742133#46742133

– SDsolar – 2017-10-14T07:52:16.753

No, *nix versions of wget and curl are not included in PowerShell. The PowerShell Invoke-WebRequest cmdlet is aliased as both wget and curl. It works similarly for very basic requests, but has substantially different parameters. – Mashmagar – 2018-07-16T13:25:07.947

Even Microsoft distributes wget.exe in the IIS Administration Pack. – paradroid – 2011-06-20T19:41:11.847

Duplicates the mis-titled "DOS Downloaders / Downloads Managers (e.g. WGET) any more?".

– JdeBP – 2011-06-21T10:59:51.113

Answers

32

Native to Windows (comes preinstalled and depends on the Background Intelligent Transfer Service (BITS) Windows service):

BITSAdmin

It can do what Wget does, and probably more (you can control an ongoing job via API-like commands - for example you can get the status speed and cancel if it is too slow).

Example usage from my own experience (you can do parallel downloads in the same .bat, or do sequential downloads in the same job):

bitsadmin /create thisissomejobname

bitsadmin /addfile thisissomejobname http://kakao.ro/Pictures.iso C:\john_pictures.iso

bitsadmin /SetCredentials thisissomejobname Server BASIC somehttpuser somehttppassword

bitsadmin /resume thisissomejobname

REM how to get status:
bitsadmin /info thisissomejobname

Note: It works on Windows XP, 7, 8 & 10 (tested on Windows 10 Pro). On Windows XP it must be installed manually from the SP2 Support Tools.

On the latest Windows 10 the deprecation warning is gone, so it looks like this useful tool is here to stay.

Tiberiu-Ionuț Stan

Posted 2011-06-20T19:22:54.703

Reputation: 499

Note: The bitsadmin client is present in Windows 8, with the same deprecation warning. – Tiberiu-Ionuț Stan – 2014-10-26T13:00:58.013

not available on XP either: "'bitsadmin' is not recognized as an internal or external command" – cmroanirgo – 2015-05-20T02:20:30.807

2This looks like the alternative to a download manager, not to a HTTP request crafter, doesn't it? – erikbwork – 2015-09-19T17:05:12.130

With powershell 3+ one can do wget -outf index.html http://superuser.com (Note there also the curl alias). From this answer

– Brice – 2016-03-16T11:52:48.213

Does it work with sites that require authentication (involves cookies)? – Peter Mortensen – 2016-12-17T17:05:25.577

@Brice It seems wget and aliases do not work anymore in the most recent versions of Windows (Server), unless you initialize Internet Explorer by opening it at least once. – Tiberiu-Ionuț Stan – 2019-01-17T11:33:23.737

Nice, but it doesn't seem to be able to call SOAP web services, like Curl can... – DAB – 2020-02-06T08:35:15.793

2check out /SetNotifyCmdLine option if you need to use this command sequentially in a .bat – Tiberiu-Ionuț Stan – 2011-10-26T12:49:26.167

5Running bitsadmin under Windows 7 displays the following warning: 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. Users beware. – yop83 – 2012-05-31T17:36:14.223

"Administrative tools for the BITS service are now provided by BITS PowerShell cmdlets." Nothing much to be beware of. Only the BITS client is deprecated, while the BITS service will remain. It will be accessible with another, similar in functionality, client (PowerShell will come preinstalled with future versions of Windows). – Tiberiu-Ionuț Stan – 2012-05-31T20:28:21.003

20

PowerShell v3 CTP1 comes with a command like wget/curl. It's called Invoke-WebRequest. To learn more, you can visit the post Windows Powershell V3 includes command like wget/curl.

Ozzie

Posted 2011-06-20T19:22:54.703

Reputation: 201

This is a great utility and comes with Windows Server 2012 R2. – sfuqua – 2015-09-10T19:30:42.200

It is also possible with PowerShell 2.0. – Peter Mortensen – 2016-05-06T17:28:09.297

As I know, Invoke-WebRequest can't ignore certificate errors (a very useful feature for developers). At least in version 3.0 – maxkoryukov – 2018-04-16T23:28:45.537

I can't get Invoke-WebRequest to ignore certificate errors in PowerShell 5.1, but the documentation in PowerShell 6 includes a SkipCertificateCheck flag: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-6

– Mashmagar – 2018-07-16T13:31:24.357

@Brice It seems wget and aliases do not work anymore in the most recent versions of Windows (Server), unless you initialize Internet Explorer by opening it at least once. – Tiberiu-Ionuț Stan – 2019-01-17T11:33:37.373

2

I see both http://superuser.com/a/25540/106977 and http://superuser.com/a/330754/106977 refer to Powershell commands. I have not tried either of them, but those links are related to this posting.

– bgoodr – 2012-06-09T00:42:28.387

12

I often use PowerShell for simple things, like WebClient's DownloadString:

$wc = New-Object Net.WebClient
$wc.DownloadString('...')

Or DownloadFile if you want something downloaded like wget does and package that off into a function. Of course, this is very rough and won't have any of the niceties like resumable downloads and similar.

Joey

Posted 2011-06-20T19:22:54.703

Reputation: 36 381

Using DownloadFile. it worked when I tried it (PowerShell 2.0): $wc.DownloadFile('http://traffic.libsyn.com/makingembeddedsystems/embedded-ep149.mp3', 'EmbeddedFm_149.mp3'). However, there is no progress information duríng the download. – Peter Mortensen – 2016-04-29T16:26:48.657

@PeterMortensen: Of course not. It's just a .NET object. You can attach an event handler to DownloadProgressChanged, though. But I guess then you'll also need to use the async variants of the methods. – Joey – 2016-04-29T16:34:56.953

6

There is no Wget alternative really. You can use Wget for Windows and assign the path in your environment variables to get it working how you want.

Sandeep Bansal

Posted 2011-06-20T19:22:54.703

Reputation: 6 168

1The problem is, the person I'm working with is getting a browser freeze on launch, and they have no access to another computer. – Jordan – 2011-06-20T19:48:22.133

2If they're running through ethernet, get them to boot into safe mode with networking? – Sandeep Bansal – 2011-06-20T19:56:22.573

6

It seems you only need to download an alternative browser. You can use this command to download Mozilla Firefox with the command prompt:

explorer.exe http://releases.mozilla.org/pub/mozilla.org/firefox/releases/6.0.2/win32/en-US/Firefox%20Setup%206.0.2.exe

This also launches Internet Explorer, but only with a basic feature set. This should work even if Internet Explorer is broken (in most cases).

You can also use the FTP command. Type the following into the command prompt commands:

  1. Type FTP - Which opens the FTP client
  2. Type open ftp.mozilla.org - Which connects to Mozilla-FTP
  3. Just login as Anonymous and use an empty password.
  4. Type cd /pub/mozilla.org/firefox/releases/4.0.1/win32/en-US/ -To change the directory
  5. Type recv "Firefox Setup 4.0.1.exe" - To download the Firefox installer. The file is located in the current folder of the command prompt. (usually your Profile folder)
  6. Type bye to close the FTP client
  7. Type exit to close the command prompt.

DiableNoir

Posted 2011-06-20T19:22:54.703

Reputation: 858

3Nice answer, but completely unrelated to the question asked. – Antimony – 2014-08-14T06:09:08.483

4Um. Seems both topical and an example of using explorer.exe as an alternative. – Michael Cole – 2015-01-14T17:40:29.060

2

Native cURL for Windows is 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.

Gaurav Kumar

Posted 2011-06-20T19:22:54.703

Reputation: 296

1

I'd just use Cygwin and install the wanted libraries... I have always done that...

In the past, I searched for alternatives, yes. But Cygwin is just the best tool for the job.

NicoJuicy

Posted 2011-06-20T19:22:54.703

Reputation: 151

2Except it is overkill installing the gazillions of files for a typical Cygwin installation just to get Wget. – Peter Mortensen – 2016-04-29T16:29:25.633

You get wget, curl, ... and much more. I suppose if you need wget you will probably use some additional linux tools in the future :) - definatly not an every day screnario though – NicoJuicy – 2016-05-04T07:46:30.147

1

I've created my own. Check it out at https://github.com/acarrilho/global (at the bottom of the page).

Download the source and, using cmd.exe, navigate to the requester folder. From there, just type http to see all the settings available. As an example:

http -u "http://www.example.com" -oc

Andre Carrilho

Posted 2011-06-20T19:22:54.703

Reputation: 11