Is there a built-in command-line tool under Windows like wget/curl?

Solution 1:

Powershell.

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

There's also Invoke-WebRequest in PS 3.0.

Solution 2:

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


Solution 3:

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


Solution 4:

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