' Source Michael Harris & Alex K. Angelopoulos ' modified by TGL May 2003 ' http://groups.google.com/groups?selm=OxJBkB8xCHA.2120%40TK2MSFTNGP11 & ' http://www.google.com/groups?selm=%23v1%23CmirAHA.2132%40tkmsftngp05 ' Defaults to current folder. 'Change to different location, as desired. Const sSavePath = ".\" ' Get URL for desired site sPage = Replace(Trim(InputBox("Target Webpage")), "http://", "") if sPage = "" then Wscript.Quit(1) ' Keep full URL for storage file, but replace slashes sName = sSavePath & Replace(sPage, "/", "_") 'Download and save the image to a file. DownBinFile sname, "http://" & sPage Wscript.Echo "Download of", sName, " is complete." Sub DownBinFile(FilePath, sURL) const adTypeBinary = 1 const adModeReadWrite = 3 const adSaveCreateOverwrite = 2 ' Create an xmlhttp object: set oXML = CreateObject("Microsoft.XMLHTTP") oXML.open "GET", sURL, False oXML.send With CreateObject("ADODB.Stream") .type = adTypeBinary .mode = adModeReadWrite .open On Error Resume Next Do Wscript.Sleep 250 .write oXML.responseBody Loop Until Err = 0 .savetofile FilePath, adSaveCreateOverwrite End With End Sub