I will try that last post but I write back because I just thought of another way to do this.. I have confirmed that for what ever reason the last script I posted is for some reason (even though the audit is not running) is changing the file modification data when applied as a pc policy via gpo. But when I run the script after the machine is at the desktop the file doesnt get modified. I wonder if it is some issue with the file being access and the machine still booting?? Anyways. As I stated before thie audit program creates a file called trackitaudit.id. This is just a text file. Will ReadLine work with this file extension even though its not .txt? If not I can script the renaming of the files. But this file has the following. Code:
id=5D5859EE-8889-412B-A5C8-448D321A64A8
LASTRUN=20040827000000
The second line is the date the audit ran last so I was thinking of using readline to extrat that text date then running the audit based on that information. I am new to some of these more complicated scripting functions and can only get an echo of the first line. Attached is the code. What am I missing to get the second line in with readline then "reuse" parts of my existing script to execute the script. I dont even know if readline is the right thing. Code:
$Inventfile = "C:\Trackitaudit.txt"
If Open (2, "$Inventfile") = 0
$date = ReadLine (2)
While Error = 0
? "Line read: [" + $date + "]"
$date = ReadLine (2)
Loop
Close (2)
? "$date"
? "@error"
EndIf
Thanks for all of the help... This has been very helpful.