-
-
Save kleo/cb0217677deebd43b23dfccf41a96917 to your computer and use it in GitHub Desktop.
wget for windows cmd (credits: https://superuser.com/a/536400/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cscript /nologo wget.js http://example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1"); | |
WinHttpReq.Open("GET", WScript.Arguments(0), /*async=*/false); | |
WinHttpReq.Send(); | |
WScript.Echo(WinHttpReq.ResponseText); | |
/* To save a binary file use this code instead of previous line | |
BinStream = new ActiveXObject("ADODB.Stream"); | |
BinStream.Type = 1; | |
BinStream.Open(); | |
BinStream.Write(WinHttpReq.ResponseBody); | |
BinStream.SaveToFile("out.bin"); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment