15
edits
Changes
changed the auti code a bit, to do with the console writing of the final report
$s_ToAddress = "-t " & $email_address
$s_Subject = "PC's with missmatched WPKG programs"
If FileExists($pc_xml_path) = 0 Then
ConsoleWrite("Error. Unable to read files in " & $pc_xml_path & ", exiting" & @CRLF)
Exit
ElseIf FileExists($master_xml_path) = 0 Then
ConsoleWrite("Error. Unable to read files in " & $master_xml_path & ", exiting" & @CRLF)
Exit
EndIf
If Not FileExists($pc_xml_path & "\invent\*") Then DirCreate($pc_xml_path & "\invent\")
; Now work out the list of installed packages for each machine generated xml file...
$filedelete = FileDelete($pc_xml_path & "\invent\*.csv")
;~ ConsoleWrite ("deleted files = " & $filedelete & @CRLF)
_make_xml_array($pc_xml_path)
;Write to the console a list of csv files in $pc_xml_path & "\invent\
$csv_files = _FileListToArray($pc_xml_path & "\invent\", "*.csv", 1)
ConsoleWrite(@CRLF)
For $r = 1 To $csv_files[0] Step 1
ConsoleWrite(StringUpper($csv_files[$r]) & @CRLF)
Next
ConsoleWrite(@CRLF & "The list of CSV files above are the files in " & $pc_xml_path & "\invent\ showing the inventory of the WPKG programs installed. " & _
"'ALL.CSV' is a concatination of all the indervidual CSV files." & @CRLF & @CRLF)
; Now sort out the mailing of the machines needing up/downgrading
_FileReadToArray($pc_xml_path & "\invent\all.csv", $all_csv_file)
$all_error_occurance_id = _ArrayFindAll($all_csv_file, "grade required", "", "", "", 1)
If @error < 1 Then For $o = 0 To _ArrayMaxIndex($all_error_occurance_id) Step 1 $error_list = $error_list & $all_csv_file[$all_error_occurance_id[$o]] & @CRLF Next ConsoleWrite("Machines and packages that differ from the Master XML files = " & @CRLF & @CRLF & $error_list & @CRLF)
EndIf
Else
ConsoleWrite("All of the pcs are up to date with their WPKG packages" & @CRLF)
EndIf
Else