; Get the current date in YYYYMMDD format $Today = "@YEAR" + Right( "0@MONTHNO", 2 ) + Right( "0@MDAYNO", 2 ) ; Create the directory if it doesn't exist If Exist( "\\Server\Logs\$Today\*.*" ) = 0 MD "\\Server\Logs\$Today" EndIf ; Read the AV software status $objWMISvc = GetObject( "winmgmts:{impersonationLevel=impersonate}!//./root/SecurityCenter" ) $colItems = $objWMISvc.ExecQuery( "SELECT * FROM AntiVirusProduct", "WQL", 48 ) For Each $objItem In $colItems $Msg = $objItem.displayName + "," + $objItem.versionNumber If $objItem.onAccessScanningEnabled = 0 $Msg = $Msg + ",FALSE," Else $Msg = $Msg + ",TRUE," EndIf If $objItem.productUptoDate = 0 $Msg = $Msg + "FALSE@CRLF" Else $Msg = $Msg + "TRUE@CRLF" EndIf Next ; Log the result If RedirectOutput( "\\Server\Logs\$Today\@USERID.log" ) = 0 $Msg $RC = RedirectOutput( "" ) EndIf