This is my VBS script to automatically download, install and run a spybot scan.

IT, checks to see if c:spybotspybotsd.exe exists, if not, it then downloads it from the URL
Then updates and scans.

If it does exist, then it updates and scans.

sTarget = “C:temp”

Set objFSO = CreateObject(“Scripting.FileSystemObject”)
If Not objFSO.FolderExists(sTarget) Then
objFSO.CreateFolder(“c:temp”)
End If

Wscript.Echo “Starting”

strFileURL = “http://www.spybotupdates.com/files/spybotsd162.exe”
strHDLocation = “c:tempspybotsd162.exe”

If objFSO.Fileexists(“c:spybotspybotsd.exe”) Then

Set WshShell = WScript.CreateObject(“WScript.Shell”)
‘ update
Wscript.Echo “Updating”
Return = WshShell.Run(“c:spybotspybotsd.exe /autoupdate /taskbarhide /autoimmunize /autoclose “, 0, true)

‘ Run scan
Wscript.Echo “Scanning”
Return = WshShell.Run(“c:spybotspybotsd.exe /autocheck /autofix /autoclose /taskbarhide “, 0, true)

Wscript.Echo “Complete”

Else Set objXMLHTTP = CreateObject(“MSXML2.XMLHTTP”)

objXMLHTTP.open “GET”, strFileURL, false
objXMLHTTP.send()

If objXMLHTTP.Status = 200 Then

Wscript.Echo “Downloading the latest version of Spybot…” & VbCrLf & VbCrLf
Set objADOStream = CreateObject(“ADODB.Stream”)
objADOStream.Open
objADOStream.Type = 1 ‘adTypeBinary

objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0

Set objFSO = Createobject(“Scripting.FileSystemObject”)
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
Set objFSO = Nothing

objADOStream.SaveToFile strHDLocation
objADOStream.Close
Wscript.Echo “Download complete” & VbCrLf & VbCrLf
Set objADOStream = Nothing
End if

‘ Install Spybot from c:tempspybotsd162.exe
Set WshShell = WScript.CreateObject(“WScript.Shell”)
Return = WshShell.Run(“c:tempspybotsd162.exe /silent /norestart /dir=c:spybot “, 0, true)

‘ update
Wscript.Echo “Updating”
Return = WshShell.Run(“c:spybotspybotsd.exe /autoupdate /taskbarhide /autoimmunize /autoclose “, 0, true)

‘ Run scan
Wscript.Echo “Scanning”
Return = WshShell.Run(“c:spybotspybotsd.exe /autocheck /autofix /autoclose /taskbarhide “, 0, true)

Wscript.Echo “Complete”

End if

I Just now need a way to get the logs back from the client machines into the GFIMax console.

I have had this running on W7, XP, Vista, Server 2003 and Server 2008 machiens.

« »