Sorry... let me post my script. I am using loadkey, but saved the keys by exporting them from regedit. This was working for me the first few time I tested the script but for some reason has stopped. I need to save the keys using savekey instead of regedit? Thanks, I'll give that a try and update in a bit.
code:
;This Script
;determains CCD (Call Center Desktop) and lock if user is not
;A domain Admin. If the PC is CDE it maps wkgroup and user drive
;and sets-up email profile if not present
;
; Jesse Liebmann 5/23/2002
$Agent = substr(@wksta, 1, 4) ;get Workstation type
?"Logging on.... Please Wait"?
? $Agent ?
;Agent Workstation
If $Agent = "WHOU" ;if 1 ;Is PC CCD?
goto "Agent"
Else ;CDE PC
Use W: /DELETE ;Map Workgroup Drive
Use W: \\HOUFPS01\Wkgroup
EndIf
$Index = 0
$keyfound = 0
$search_location="HKEY_CURRENT_USER\Software\Microsoft\Windows Messaging Subsystem\Profiles"
If (KeyExist($search_location) = 1) ; 1 if found
$KeyName = EnumKey("HKEY_CURRENT_USER\Software\Microsoft\Windows Messaging Subsystem\Profiles", $Index)
While @ERROR = 0
$keyfound = $keyfound + 1
$Index = $Index + 1
$KeyName = EnumKey("HKEY_CURRENT_USER\Software\Microsoft\Windows Messaging Subsystem\Profiles", $Index)
Loop
Else
$search_location="HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
If (KeyExist($search_location) = 1) ; 3 if found
$KeyName = EnumKey("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles", $Index)
While @ERROR = 0
$keyfound = $keyfound + 1
$Index = $Index + 1
$KeyName = EnumKey("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles", $Index)
Loop
EndIf ; 3 if end
EndIf ;1 if end
If $keyfound = 0
$createprofile = @LSERVER + "\NETLOGON\Profgen.exe " + @LSERVER + "\NETLOGON\Newprof.exe -P " + @LSERVER + "\NETLOGON\Custom.prf -X -R -L"
Run $createprofile
? "Email profile created"
sleep 1
Endif
goto "END"
:Agent
IF INGROUP("Domain Admins") = 0 ; true if user NOT a Domain Admin
LoadKey("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "c:\Reg\LockDown.reg")
ELSE
LoadKey("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "c:\Reg\Unlock.reg")
Use "*" /Delete
Use I: \\HOUFPS01\INSTALL$
Use W: \\Wkgroup
endif
:END
Exit