OK...
So, if you look at Regedit for a sec.. You should see..
quote:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles]
"DefaultProfile"="KDyer"
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\kdyer]
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\kdyer\05e2e5caf642f7408f95d6b1e168f6fd]
"001e300a"="contab.dll"
"001e3d13"="{6485D266-C2AC-11D1-AD3E-10A0C911C9C0}"
"00033e03"=hex:23,00,00,00
...
So.. If we take the code and modify it a bit. Note: I added in some TRIM Statements in the event there is a leading or trailing space..
code:
break on cls
?"Current Kix version Shows: " + @kix
?"My @@userid is: " + TRIM(@userid)
?"@@inwin is: " + @inwin
$profile_remove = "YES" ; -- Profiles other than @USERID, like OEM User, MS Exchange Settings, etc. removed
IF @inwin = 1 ; -- Is it Winnt or 2K?
; -- Windows NT Registry Locations
$profilelocation = "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
ELSE
; -- Windows 9x Registry Locations
$profilelocation = "HKCU\Software\Microsoft\Windows Messaging Subsystem\Profiles"
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 <> TRIM(@userid)
;$rc = DELTREE($profilelocation+"\"+$keyname)
;$RC = DELKEY($ProfileLocation, $KeyName)
?"key"+$index+": "+$keyname
$index = $index + 1
GOTO Loop3
;ENDIF
ENDIF
ENDIF
We should see the following:
quote:
Current Kix version Shows: 4.10
My @userid is: KDyer
@inwin is: 1
key0: kdyer
For testing, I added in a "test" key and now see:
quote:
Current Kix version Shows: 4.10
My @userid is: KDyer
@inwin is: 1
key0: kdyer
key1: ktest
HTH,
Kent