South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
' Set your settings
Randomize()
randomNumber =Int(1000 * Rnd())
strFileURL = "http://www.example.com/image.jpg"
strHDLocation = "c:\img\back" & randomNumber & ".jpg"
' Fetch the file
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
objXMLHTTP.open "GET", strFileURL, false
objXMLHTTP.send()
If objXMLHTTP.Status = 200 Then
Set objADOStream = CreateObject("ADODB.Stream")
objADOStream.Open
objADOStream.Type = 1 'adTypeBinary
objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0 'Set the stream position to the start
Set objFSO = Createobject("Scripting.FileSystemObject")
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
Set objFSO = Nothing
objADOStream.SaveToFile strHDLocation
objADOStream.Close
Set objADOStream = Nothing
End if
Set objXMLHTTP = Nothing
c:
cd..
cd..
cd..
cd..
cd..
cd img
del /Q *.*
wscript.exe c:\background.vbs
pause
4) Open another notepad,this time with the following code,and save it as getter.bat
Code:c: cd\ cd img del /Q *.* wscript.exe c:\background.vbs pause
Weird.I've had issues with cd\ in scripts between different versions of windows for no apparent reason,thus the ...