tags:

views:

33

answers:

2

Ive got a VBS Script that generates an url to download a file from a server on my network. I now need to download the file to "C:\rWallpaper\wallpaper.png", the URL is stored in the variable "url"

Id like it to work something like wget on linux, just download and save the file to a specified location.

+1  A: 

You could try this link:

http://www.robvanderwoude.com/vbstech_internet_download.php

openshac
+1  A: 

You can download using XMLHTTP and leverage an ADO stream to write the binary data;

dim xHttp: Set xHttp = createobject("Microsoft.XMLHTTP")
dim bStrm: Set bStrm = createobject("Adodb.Stream")
xHttp.Open "GET", "http://bla.com/xxx.png", False
xHttp.Send

with bStrm
    .type = 1 '//binary
    .open
    .write xHttp.responseBody
    .savetofile "c:\temp\xxx.png", 2 '//overwrite
end with
Alex K.