#124458 - 2004-08-04 07:14 PM
Writevalue
|
Glen
Fresh Scripter
Registered: 2004-08-04
Posts: 6
Loc: UK
|
Hi wonder if you can help me. Im trying to edit my log on script so that it does a couple of registry changes however Im finding that when I do this the script ends before it should.
Following is an extract from my logon script.
Basically it checks what group you are in and applies the appropiate drives and registry changes.
However it only checks the first in group rule and if your in both these groups (GG_Server1 and GG_Server2) it doesnt do the 2nd at all but ONLY if i have a writevalue in the if statement above, If I take this out it works no problem.
Please dont read too much into what the change is its only a section of the changes but all lines are almost same.
Can anyone help please?
Thanks
Glen
IF InGroup("WMS\GG_SERVER1") = 1 ? "Mapping SERVER1 Drives" Use U: /Delete /PERSISTENT USE U: "\\SERVER1\Department Data" Use H: /Delete /PERSISTENT USE H: "\\SERVER1\Home" ; Home Drives
writevalue( "HKEY_CURRENT_USER\Control Panel\Desktop" , "SmoothScroll" , "00,00,00,00", "REG_BINARY" )
ENDIF
? "endit 1"
IF InGroup("WMS\GG_SERVER2") = 1 ? "Mapping Logic Drives" Use L: /Delete /PERSISTENT USE L: "\\SERVER\User" ; Home Drives
writevalue( "HKEY_CURRENT_USER\Control Panel\Desktop" , "SmoothScroll" , "00,00,00,00", "REG_BINARY" )
ENDIF
|
|
Top
|
|
|
|
#124459 - 2004-08-04 07:32 PM
Re: Writevalue
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Welcome to the board!
You are pretty close..
it should be - Code:
$rc=writevalue("HKCU\Control Panel\Desktop", "SmoothScroll", "00000000", "REG_BINARY")
HTH,
Kent
|
|
Top
|
|
|
|
#124460 - 2004-08-04 07:38 PM
Re: Writevalue
|
Glen
Fresh Scripter
Registered: 2004-08-04
Posts: 6
Loc: UK
|
Thank you sorry I was wrong with the line. However putting the $rc= at the start of each writevalue line doesnt seem to fix the if in group problem. It simply ignores the 2nd group membership because of writevalue.
Thanks
|
|
Top
|
|
|
|
#124462 - 2004-08-04 08:49 PM
Re: Writevalue
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Glen,
Les' response is correct.. It is the comma thing that is probably stopping this.
Kent
|
|
Top
|
|
|
|
#124463 - 2004-08-04 08:51 PM
Re: Writevalue
|
Glen
Fresh Scripter
Registered: 2004-08-04
Posts: 6
Loc: UK
|
Sorry I should have mentioned I removed the commas in this line "00,00,00,00" before or am I being stupid and missing others?
Glen
|
|
Top
|
|
|
|
#124464 - 2004-08-04 08:56 PM
Re: Writevalue
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Try with a Debug ON and see where you are stopping..
You may also need to flush the token cache for KiX.
Kent
|
|
Top
|
|
|
|
#124466 - 2004-08-04 09:18 PM
Re: Writevalue
|
Glen
Fresh Scripter
Registered: 2004-08-04
Posts: 6
Loc: UK
|
ok thank you both for your quick answers.
Im going to try using /F when starting my scripts which I believe is the way to flush the cache (did a search) I assume I can just put this in as a standard thing whenever i start a kix script? or is there a time when I shouldnt be using it?
I dont think I have any cirly brackets but Ill check that.
If all that doesnt work ill try the debug on
Ill post what fixed it once i find out.. hopefully one of those does
Ive gone home from work now so will try in thr morning..
Thanks again
Glen
Edited by Glen (2004-08-04 09:19 PM)
|
|
Top
|
|
|
|
#124468 - 2004-08-05 12:44 PM
Re: Writevalue
|
Glen
Fresh Scripter
Registered: 2004-08-04
Posts: 6
Loc: UK
|
Thanks both, I found the problem.
There was a mistake (as you said) with the quotes. All were the right kind of quote however I was missing one.
What I didnt realise (have been using kix for a few years to a basic level) that kix must parse the entire script first.
I always thought it did a step through parse line by line. Reason I say this was because the mistake was below the point where it was actually bombing out within the 2nd IF statement. So running debugging it was hitting the 2nd IF in group statement and then litterly igoring the enitre contents of it because there wasa mistake with a command inside the IF statement and ending the script.. interesting error checking. So I was pretty much looking at the wrong point of the script for the problem.
Thanks again
Glen
Edited by Glen (2004-08-05 12:45 PM)
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1046 anonymous users online.
|
|
|