Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for login_log_av_win7.vbs

(view source code of login_log_av_win7.vbs as plain text)

  1. ' Query the AV status
  2. Set objWMISvc = GetObject( "winmgmts:{impersonationLevel=impersonate}!//./root/SecurityCenter2" )
  3. Set colItems  = objWMISvc.ExecQuery( "SELECT * FROM AntiVirusProduct" )
  4. For Each objItem in colItems
  5. 	strMsg = strMsg & objItem.displayName & "," & objItem.versionNumber & vbCrLf
  6. Next
  7. Set colItems  = Nothing
  8. Set objWMISvc = Nothing
  9. ' Log the result; variable 'strLog' and constant 'ForAppending' need to be set before
  10. Set objFSO = CreateObject( "Scripting.FileSystemObject" )
  11. Set objLog = objFSO.OpenTextFile( strLog, ForAppending, True, TristateFalse )
  12. objLog.WriteLine strMsg
  13. objLog.Close
  14. Set objLog = Nothing
  15. Set objFSO = Nothing

page last uploaded: 2021-01-27