Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to download a file through http from the command line on a windows server 2008. I am looking for something like wget, but it must be a built-in tool.

Is there such a tool?

share|improve this question
Is PowerShell a built-in tool for you? – mailq Aug 15 '11 at 8:16
Yes, PowerShell is ok. – steenhulthin Aug 15 '11 at 8:28
up vote 13 down vote accepted

If you have PowerShell installed...

(New-Object System.Net.WebClient).DownloadFile("","icanhazip.txt")
share|improve this answer
Note for those not familiar with this call. The first argument is to the file to download, the second is what to save it as locally. – John Apr 11 '12 at 14:43
For some reason this wouldn't work for me until I included the path in where to save it locally: (New-Object System.Net.WebClient).DownloadFile("‌​/8C5EEDC7-3D72-4BB6-A55E-37F3977CD892/wpilauncher.exe","C:\wpilauncher.exe") – Chris Magnuson Jun 27 '13 at 17:45

you use curl also:

something like

curl -O

should work

share|improve this answer
curl is nice, but not built-in. – steenhulthin Aug 15 '11 at 8:52

No wget equivalent that is built-in/default across Windows.

share|improve this answer

I would liek to use the powershell way, however, when used to get at some pages, like those with erronous ssl code (self signed, or other) you need to set the expectations first before the call

[Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
$wc = New-Object System.Net.WebClient

$wc.DownloadFile ( "", "LocalFileName.htm" )

This in turn will fail too, if it redirects to many times, f.ex. if it needs cookies to keep etc etc...

So sadly, without writing a small executable on my own there doesnt seem to be something besides wget that really can handle all situations so far... would love to be wrong.

share|improve this answer
If you need cookies, you are probably breaking ToS by downloading it via CLI anyway. – Daniel Widrick Jul 4 '13 at 13:20

protected by Community Aug 11 '14 at 20:27

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.