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?
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?
If you have PowerShell installed...
(New-Object System.Net.WebClient).DownloadFile("http://icanhazip.com/","icanhazip.txt")
(New-Object System.Net.WebClient).DownloadFile("http://download.microsoft.com/download/8/C/5/8C5EEDC7-3D72-4BB6-A55E-37F3977CD892/wpilauncher.exe","C:\wpilauncher.exe")
Jun 27, 2013 at 17:45
powershell "your command with quotes escaped by a backslash"
to make it work.
May 2, 2017 at 16:31
you use curl also: http://curl.haxx.se/docs/manpage.html
something like
curl -O http://domain.com/file.gz
should work
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 ( "https://thesite.com/myPage", "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.