Created
August 20, 2015 17:06
-
-
Save mire777/a1b391ff4426039d704b to your computer and use it in GitHub Desktop.
bio_photos.vbs
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
If (WScript.Arguments.Count <> 2) Then | |
WScript.Quit | |
End If | |
url = WScript.Arguments(0) | |
file = WScript.Arguments(1) | |
Set objFSO = Createobject("Scripting.FileSystemObject") | |
If objFSO.Fileexists(file) Then | |
Set objFSO = Nothing | |
WScript.Quit | |
End If | |
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP") | |
objXMLHTTP.open "GET", url, false | |
objXMLHTTP.send() | |
If objXMLHTTP.Status = 200 Then | |
Set objADOStream = CreateObject("ADODB.Stream") | |
objADOStream.Open | |
objADOStream.Type = 1 | |
objADOStream.Write objXMLHTTP.ResponseBody | |
objADOStream.Position = 0 | |
objADOStream.SaveToFile file | |
objADOStream.Close | |
Set objADOStream = Nothing | |
End If | |
Set objFSO = Nothing | |
Set objXMLHTTP = Nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment