Answers for "how to download a file from the internet using vbs"

0

how to download a file from the internet using vbs

Set args = WScript.Arguments
 
'// you can get url via parameter like line below
'//Url = args.Item(0)
 
 Url = "/mypdf.pdf"
dim xHttp: Set xHttp = createobject("Microsoft.XMLHTTP")
dim bStrm: Set bStrm = createobject("Adodb.Stream")
xHttp.Open "GET", Url, False
xHttp.Send
 
with bStrm
    .type = 1 '//binary
    .open
    .write xHttp.responseBody
    .savetofile "d:\DownloladPdf.pdf", 2 '//overwrite
end with
Posted by: Guest on July-15-2021

Code answers related to "how to download a file from the internet using vbs"

Browse Popular Code Answers by Language