this is a script that I use to watch my users PC's to see if they are installing programs behind my back...

code:

:NTInst ; ****************** Detect Installs ***********************
;
; This code detects a change in the number
; of subdirectories in the $dir directory.
;

; variables
$dir=DIR("c:\program files\*.*")
$contents="$logon\inventory\ProgFls.txt"
$loopctr=0

; determine the current number of subdirectories in $dir
While $dir <> "" and @ERROR = 0
$loopctr=$loopctr+1
$dir=Dir()
Loop

; compare the current number of directories to the last reported number
$oldcount=readprofilestring($contents,"Dir_Count","@wksta")

; if there's a difference, send a message to $DCSA
if $loopctr<>$oldcount
$=sendmessage("$dcsa","The dir count on @wksta has changed from $oldcount to $loopctr")
? " dir count on @wksta has changed from $oldcount to $loopctr"
$=writeprofilestring($contents,"Dir_Count","@wksta","$loopctr")
endif
return


_________________________
How to ask questions the smart way <-----------> Before you ask