Download a file via HTTP from a script in Windows

Posted by Jason R. Coombs on Super User See other posts from Super User or by Jason R. Coombs
Published on 2010-04-09T18:14:13Z Indexed on 2010/04/09 18:23 UTC
Read the original article Hit count: 455

Filed under:
|
|
|
|

I want a way to download a file via HTTP given its URL (similar to how wget works). I've seen the answers to this question, but I have two changes to the requirements:

  • I'd like it to run on Windows 7 or later (though if it works on Windows XP, that's a bonus).
  • I need to be able to do this on a stock machine with nothing but the script, which should be text that could be easily entered on a keyboard or copy/pasted.
  • The shorter, the better.

So, essentially, I'd like a .cmd (batch) script, VBScript, or Powershell script that can accomplish the download. It could use COM or invoke IE, but it needs to run without any input, and should behave well when invoked without a display (such as through a telnet session).

© Super User or respective owner

Related posts about windows-7

Related posts about wget