Page 1 of 1 1
Topic Options
#46192 - 2003-09-30 10:20 AM editing reg key's
richard_korsten Offline
Fresh Scripter

Registered: 2003-09-18
Posts: 5
Loc: utrecht
[Moderator (Sealeopard): Moved thread from 'Scripts' to 'Starters' forum due to lack of script in body]

dear board reader.

i want to edit some reg keys with kixtart. but i have a problem with the fact that the changes dont take effect right away but it need to restart. does anyone knows how to help this problem.

i am useing windows 2000 domain and 2000 ciënts.

and i can't use reg edit.

greatings richard korsten

[ 30. September 2003, 15:58: Message edited by: sealeopard ]

Top
#46193 - 2003-09-30 10:28 AM Re: editing reg key's
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I might suggest reading the first topic in faq.
named something like ABC...
_________________________
!

download KiXnet

Top
#46194 - 2003-09-30 02:09 PM Re: editing reg key's
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Where is the script? Like Lonkero suggests - In the FAQ, there is an ABC Document..

First of all - What? What registry Key(s)? We cannot guess what you are trying to do.

Second - Why? Why is this needed?

Third - Who? Who is your target audience? Do they have rights to change these keys?

quote:

and i can't use reg edit.

We get a partial answer with this - if the client cannot use Regedit, then there is a policy/GPO been implemented on these users. I would start there, rather than hacking the Registry.

HTH,

Kent

[ 30. September 2003, 14:12: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#46195 - 2003-09-30 03:08 PM Re: editing reg key's
richard_korsten Offline
Fresh Scripter

Registered: 2003-09-18
Posts: 5
Loc: utrecht
here is a part of the script i am going to use.

If InGroup ("Test groep")
$Desktop=ReadValue('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders','Desktop')
$server=@LSERVER
If 0=Exist($Destkop)
Copy "\\%logonserver%\slkplgn" $Desktop
If @ERROR = 0
? "je kunt gaan werken op je pc."
Sleep 20
Else
? "er is iets fout gegaan"
Sleep 5
EndIf
EndIf
If KeyExist ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\NonEnum")
? "we doen niks"
Else
AddKey ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\NonEnum")
WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\NonEnum","{20D04FE0-3AEA-1069-A2D8-08002B30309D}","1","REG_DWORD")
AddKey ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\NonEnum")
WriteValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\NonEnum","{20D04FE0-3AEA-1069-A2D8-08002B30309D}","1","REG_DWORD")
EndIf

but yes we have policies but what i want to change is not change able with a policy.

i know that we have to change the keys stated above.

what am i doing wrong here.

Richard

Top
#46196 - 2003-09-30 03:35 PM Re: editing reg key's
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
The macro @LServer and the environment variable %LOGONSERVER% will both return a fully-qualified path (e.g. "\\lserver"), thus the following line has an error in it's syntax:

code:
Copy "\\%logonserver%\slkplgn" $Desktop

Try...
code:
Copy @LSERVER+"\slkplgn" $Desktop

...instead.

Top
#46197 - 2003-09-30 04:02 PM Re: editing reg key's
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
This is a cross-post from http://www.kixscripts.com/forum/tm.asp?m=2784

As I've already explained to the original poster in an PM he sent to me, the HKCU Policies registry key section requires administrative privileges in order to write to it.

Adn the regvalues should be changed via GPO, anyway.

[ 30. September 2003, 16:03: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#46198 - 2003-09-30 04:08 PM Re: editing reg key's
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
You are missing a final ENDIF..

quote:

Warning KIXSTRIP: 1 error in block structure. missing statement(s).
- do:until [0:0]
- for|each:in|to:step|next [0|0:0|0:0|0]
- function:endfunction [0:0]
-ERROR- - if:else:endif [4:2:3]
- select:case:endselect [0:0:0]
- while:loop [0:0]
4 block_structures found.
Informative KIXSTRIP: no UDF's found.
Warning KIXSTRIP: some lines contains errors or possible errors.

This is confusing.. Are you meaning to say that there is no desktop?

IF 0=Exist($destkop)

Again, this really needs to be a GPO and Jens is right in the Registry Key containing "Policies" is a red-flag to this.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#46199 - 2003-09-30 04:20 PM Re: editing reg key's
IRa Offline
Fresh Scripter

Registered: 2003-09-09
Posts: 28
Loc: Denmark
Your problem is, that you are adjusting a Shell Policy. Before it is applied, the shell must be restarted.

Try this:
code:
.
.
.
Else
$Ret=WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\NonEnum","{20D04FE0-3AEA-1069-A2D8-08002B30309D}","1","REG_DWORD")
$Ret=FindProc("Explorer.exe",,1)
EndIf
Exit

;*** FindProc, curtesy Radimus
FUNCTION FindPROC($PROC,optional $COMPUTER, optional $terminate)
dim $GetObject, $Select
if not $computer $computer=@wksta endif
$GetObject="winmgmts:{impersonationLevel=impersonate}!//$COMPUTER"
$select="select * from Win32_Process where Name='$PROC'"
For each $Process in GetObject("$GetObject").ExecQuery("$select")
if $terminate $Ret=$Process.Terminate endif
$FindPROC=$Process.ProcessId
Next
ENDFUNCTION

Note that the user might not have write privilege to write in Local Machine, and is not needed.

And btw, Yes it can be done with a Policy (you have to write the adm template yourself, though).

Best regards

Top
#46200 - 2003-09-30 04:22 PM Re: editing reg key's
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
quote:
i am useing windows 2000 domain and 2000 ciënts
In that case you should be using GPOs are they were intended to be used.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#46201 - 2003-09-30 04:28 PM Re: editing reg key's
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Even the shell restart has been explained in my PM to him. I'm sorry but we already tried to help him in multiple ways.
_________________________
There are two types of vessels, submarines and targets.

Top
#46202 - 2003-10-02 02:42 AM Re: editing reg key's
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

We suggest that you decrease your SLEEP values. Twenty seconds to wait for a simply
message "everything is ok" can be very frustrating for users. Generally everybody
can read those information within five seconds.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#46203 - 2003-10-02 04:38 AM Re: editing reg key's
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
I am becoming a convert to GPO/Policy... Too many registry hacks really muddy the water. I am with Les on this one.

If it is appropriate to edit the Registry, then by all means..

I am off my soapbox now!

Kent

[ 02. October 2003, 04:39: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#46204 - 2003-10-02 11:55 AM Re: editing reg key's
Richie19Rich77 Offline
Seasoned Scripter
*****

Registered: 2002-08-16
Posts: 624
Loc: London, England
GPO's are good but I find that if you have a tree structure OU, and you set basic GPO settings at top level, and so on until you reach the OU that the users is in, it takes a while for the user to logon.

I have found that keep the number of GPO that a users reads down to a minimum, evan if it means replicating data within the GPO across different OU's.

Top
#46205 - 2003-10-03 12:37 AM Re: editing reg key's
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
That's what Microsoft says.... [Big Grin]
_________________________
Co


Top
#46206 - 2003-10-02 01:23 PM Re: editing reg key's
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
co, good siggy you got there [Wink]
_________________________
!

download KiXnet

Top
#46207 - 2003-10-02 01:42 PM Re: editing reg key's
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
I think you know who my inspirator is.... [Big Grin]
_________________________
Co


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 302 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.07 seconds in which 0.027 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