39

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!

  • to be honest.. wget and curl aren't really built-in commands. – Mike Jan 4 '16 at 13:43
  • 1
    Windows 8.1, October 2017 - curl and wget are both included in PowerShell, as this shows: stackoverflow.com/questions/33364752/… – SDsolar Oct 14 '17 at 7:53
11

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

  • 1
    Thanks! I was hoping for a native binary, but... what the heck -- wget it is! :D – carlspring Mar 1 '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 1 '18 at 9:11
24

Powershell.

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

There's also Invoke-WebRequest in PS 3.0.

  • I was really hoping for a native implementation part of the system. – carlspring Mar 1 '13 at 14:08
  • 5
    It is a native part of the system. It comes with Windows out of the box. – Ryan Ries Mar 1 '13 at 14:09
13

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

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

Or golfed

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

Download a file via HTTP in Windows

  • 1
    I just checked... "wget" is a built-in alias for Invoke-WebRequest. :) – Charles Burge Aug 7 '17 at 7:30
  • 3
    @CharlesBurge it is removed with PowerShell 6 – Steven Penny Aug 7 '17 at 11:28
7

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

protected by Community Jan 4 '16 at 14:20

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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