54

I come from a Linux/Unix background and I have been wondering if Windows has a binary that can download files from the console.

I would like to automate a certain process and one of my requirements it to not install much software, but use the built-in stuff as much as possible.

Thanks!

carlspring
  • 713
  • 1
  • 7
  • 12
  • to be honest.. wget and curl aren't really built-in commands. – Mike Jan 04 '16 at 13:43
  • 1
    Windows 8.1, October 2017 - curl and wget are both included in PowerShell, as this shows: https://stackoverflow.com/questions/33364752/equivalent-of-wget-command-line-for-windows-8-1/46742133#46742133 – SDsolar Oct 14 '17 at 07:53
  • 1
    I don't have sufficient cred to post an answer on this site yet, but the accepted answer is incorrect. In fact, there is an out-of-box alternative on windows: `bitsadmin /transfer myDownloadJob /download /priority normal https://path/to/remote/file.txt c:\path\to\local\file.txt` – aaronsteers Oct 31 '19 at 20:00
  • 2
    UPDATE: As of Windows 10 build 17063 curl has been added to Windows – Bogdan Stefanescu May 05 '20 at 14:39

4 Answers4

30

cURL

Windows 10 includes curl.exe:

https://techcommunity.microsoft.com/t5/containers/-/ba-p/382409

so you can do something like this:

# example 1
curl.exe --output index.html --url https://superuser.com
# example 2
curl.exe -o index.html https://superuser.com

If you have older Windows, you can still download it:

https://curl.haxx.se/windows

PowerShell

# example 1
Invoke-WebRequest -OutFile index.html -Uri https://superuser.com
# example 2
iwr -outf index.html https://superuser.com

https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-webrequest

Zombo
  • 1
  • 1
  • 16
  • 20
28

Powershell.

$wc = New-Object System.Net.WebClient
$wc.DownloadFile($source, $dest)

There's also Invoke-WebRequest in PS 3.0.

Ryan Ries
  • 55,481
  • 10
  • 142
  • 199
12

There is no wget like built-in command in Windows. You can use the .net Framework via Windows PowerShell like in this example:

https://superuser.com/questions/362152/native-alternative-to-wget-in-windows-powershell

or like i do and use wget for Windows:

http://gnuwin32.sourceforge.net/packages/wget.htm

user1008764
  • 1,176
  • 2
  • 8
  • 12
  • 1
    Thanks! I was hoping for a native binary, but... what the heck -- wget it is! :D – carlspring Mar 01 '13 at 14:09
  • The gnu version of wget for windows has a major bug that makes it crash when downloading large files. – Juan Jimenez Mar 01 '18 at 09:11
  • 1
    I don't have sufficient cred to post an answer on this site yet, but the accepted answer is incorrect. In fact, there is an out-of-box alternative on windows: `bitsadmin /transfer myDownloadJob /download /priority normal https://path/to/remote/file.txt c:\path\to\local\file.txt` – aaronsteers Oct 31 '19 at 20:00
8

I like http-ping utility. You can run with these settings: ping once and save the contents to google.html

http-ping.exe -n 1 http://www.google.com/ -f google.html

It does not require installation. Check more about http-ping here

Abhijeet Kasurde
  • 983
  • 9
  • 20
mstrumyla
  • 89
  • 1
  • 2