|
Basically, if the computer name is there or not there, I want to exit or write a line to a csv file.
This is my first attempt at adding code here. I am uncertain if I need [] brackets or not...we will see.
CODE $Script = "$LogPath\CompHardware.csv" $SearchWord = "C-205" $FSO = CreateObject("Scripting.FileSystemObject") $ReadScript = $FSO.OpenTextFile($Script, 1, -1) While not $ReadScript.AtEndOfLine $var = InSTR($ReadScript.ReadLine,$SearchWord) If $var <> 0 GoTo "End" EndIf $RES=WRITELINE(5,$LogText+$RETURN) Loop $ReadScript.Close $FSO = "" ? $fnCount /CODE
Below is a sample of the CSV file..... C-205,0015C5A97814,Intel Pentium Model 14,1664,Intel 11.1.0.86,Windows XP Professional,Service Pack 2
Reasons for using csv files is that I can quickly review all computers to see if something is outdated/missing or needs to be addressed on a single page and I can sort each column in Excel. I am looking to get into WMI someday.
|