' ***************************************************************
' * wget.vbs          By Vittorio Pavesi (www.vittorio.tk) 	*
' *								* 
' * Retrieve a file from an URL and save it to the Hard Disk   	*
' ***************************************************************

    URL = "http://voxel.dl.sourceforge.net/sourceforge/healthmonitor/HealthMonitor_ver1.9.pdf"
    saveTo = "C:\HealthMonitor_ver1.9.pdf"
 
    Set Obj1 = CreateObject("MSXML2.ServerObj1")   
    Obj1.open "GET", URL, false
    Obj1.send()
	Set Obj2 = CreateObject("ADODB.Stream")
	Obj2.Open
	Obj2.Type = 1 'adTypeBinary
	Obj2.Write Obj1.ResponseBody 'Give the XML string to the ADO Stream
	Obj2.Position = 0    'Set the stream position to the start
	Set FSO = Createobject("Scripting.FileSystemObject")
	if fso.Fileexists(saveTo) then Fso.DeleteFile hdLocation
	set FSO = Nothing
	Obj2.SaveToFile saveTo
	Obj2.Close
	Set Obj2 = Nothing
    Set Obj1 = Nothing