Page 1 of 1 1
Topic Options
#23347 - 2002-06-17 04:58 PM Script problem with REG keys
JJscorpio Offline
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 Offline
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!!! [Smile]
Any help that you can offer would be wonderful.

Thanks,

Jesse

Top
#23349 - 2002-06-17 05:02 PM Re: Script problem with REG keys
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
haven't got that error.
Have you tried it with loadkey?
if so, did you save it with savekey?

kixtart does not load regedit files, but they need to be loaded with regedit.

cheers.

btw, wellcome on board!
_________________________
!

download KiXnet

Top
#23350 - 2002-06-17 05:07 PM Re: Script problem with REG keys
JJscorpio Offline
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 Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Try saving your key with Regedt32.exe then using load key.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#23352 - 2002-06-17 05:12 PM Re: Script problem with REG keys
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
jesse, there is other, maybe easier way.
use:
shell "regedit /s your_regedit_file.reg"

this way you can put all the settings at one even thou they are going to multiple places.

loadkey savekey uses the file syntax which is not readable and as such editable with just texteditor.

cheers,
_________________________
!

download KiXnet

Top
#23353 - 2002-06-17 07:06 PM Re: Script problem with REG keys
JJscorpio Offline
Fresh Scripter

Registered: 2002-06-17
Posts: 34
Loc: Houston, Tx
Saving the regs keys in regedt32 did the trick! Thanks Howard and Lonkero. [Big Grin]
My first script is now working as expected. Looking forward to more challenges and probably more help [Wink]

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1183 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.058 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org