#23347 - 2002-06-17 04:58 PM
Script problem with REG keys
|
JJscorpio
Fresh Scripter
Registered: 2002-06-17
Posts: 34
Loc: Houston, Tx
|
Hello all,
I need some help... I have spent several hours now trying to figure out why my script is not working! I am getting error 1017 (ERROR_NOT_REGESTRY_FILE)when trying to load a regestry key.
|
|
Top
|
|
|
|
#23348 - 2002-06-17 05:02 PM
Re: Script problem with REG keys
|
JJscorpio
Fresh Scripter
Registered: 2002-06-17
Posts: 34
Loc: Houston, Tx
|
TAB key is getting better of me! I wanted to say Hello and I am new to Kix. This is my first script and the E-mail profile creation part was written by another author (forgot where I got it). I have written several scripts in the past few weeks and I learning to LOVE kix! Don't know how I got along without it!!! Any help that you can offer would be wonderful.
Thanks,
Jesse
|
|
Top
|
|
|
|
#23350 - 2002-06-17 05:07 PM
Re: Script problem with REG keys
|
JJscorpio
Fresh Scripter
Registered: 2002-06-17
Posts: 34
Loc: Houston, Tx
|
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
|
|
Top
|
|
|
|
#23351 - 2002-06-17 05:08 PM
Re: Script problem with REG keys
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Try saving your key with Regedt32.exe then using load key.
|
|
Top
|
|
|
|
#23353 - 2002-06-17 07:06 PM
Re: Script problem with REG keys
|
JJscorpio
Fresh Scripter
Registered: 2002-06-17
Posts: 34
Loc: Houston, Tx
|
Saving the regs keys in regedt32 did the trick! Thanks Howard and Lonkero. My first script is now working as expected. Looking forward to more challenges and probably more help
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1183 anonymous users online.
|
|
|