Chris,

Have you tried the new version of the script? It is cleaner.. The old version is still there for ideas of what you can do with scripting.

If needed, have you tried uncommenting the line -

; -- Uncomment for debugging

And then running the script in debug mode?

Back to your point.. You should have at a minimum the following code to remove old profiles:

code:
 $profile_remove = "YES" ; -- Profiles other than @USERID, like OEM User, MS Exchange Settings, etc. removed
$deleteitems = "Yes" ; -- Do you want your users to delete all deleted items on Exit from Outlook?

IF (@inwin = 1) ; -- Is it Winnt or 2K?
; -- Windows NT Registry Locations
$profilelocation = "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
$windir = READVALUE("HKLM\Software\Microsoft\Windows NT\CurrentVersion","SystemRoot")
ELSE
; -- Windows 9x Registry Locations
$profilelocation = "HKCU\Software\Microsoft\Windows Messaging Subsystem\Profiles"
$windir = READVALUE("HKLM\Software\Microsoft\Windows\CurrentVersion","SystemRoot")
ENDIF

IF $profile_remove = "YES"
; -- If it does not exist, delete out any odd-ball Profiles
; -- Like OEM user, etc.
$index = 0
:loop3
$keyname = ENUMKEY($profilelocation, $index)
IF @error = 0
;? "Name found: $KeyName" ; -- Uncomment for debugging
; -- Going to check for @userid
IF $keyname <> @userid
$rc = DELTREE($profilelocation+"\"+$keyname)
;$RC = DELKEY($ProfileLocation, $KeyName)
$index = $index + 1
GOTO Loop3
ENDIF
ENDIF
ENDIF

HTH,

Kent

[ 27 July 2002, 08:01: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's