Page 1 of 1 1
Topic Options
#172446 - 2007-01-05 08:36 PM How to add item to the Registry?
ClarkKent Offline
Fresh Scripter

Registered: 2006-07-28
Posts: 5
Hello Experts,

I'm new to this. I have a basic working script, but I need the registry modified when a user logs in with kix script. Anyone know how to do that. Item I need changed is below.

HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\10.0\Outlook\DisabledCmdBarItemsList
Value Name: TCID1
Value Type:
String Value: 5654

Top
#172447 - 2007-01-05 08:43 PM Re: How to add item to the Registry? [Re: ClarkKent]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
from the manual http://www.kixtart.org/manual

Quote:

WRITEVALUE
Action


Creates a new key, adds another value-name to an existing key (and assigns it a value), or changes the value of an existing value-name.



Syntax


WRITEVALUE ("subkey", "entry", "expression", "data type")



Parameters


Subkey

Identifies the subkey where you want to write a value entry.

Entry

The name of the entry. To write to the default entry of a key, specify an empty string as the entry name ("").

Expression

The data to store as the value of the entry.

REG_MULTI_SZ (multi-string) variables are returned with the pipe symbol ( | ) used as the separator between strings. If a string contains a pipe symbol character, it is represented by two pipe symbol characters ( || ).

Data type

Identifies the data type of the entry.

The following data types are supported:

· REG_NONE

· REG_SZ

· REG_EXPAND_SZ

· REG_BINARY

· REG_DWORD

· REG_DWORD_LITTLE_ENDIAN

· REG_DWORD_BIG_ENDIAN

· REG_LINK

· REG_MULTI_SZ

· REG_RESOURCE_LIST

· REG_FULL_RESOURCE_DESCRIPTOR



Returns




0
Value entry written

Error code
Function failed




Example


WriteValue("EZReg\Test", "A MultiString variable", "Line 1|Line 2|Line 3 with a || in it|", "REG_MULTI_SZ")

If @ERROR = 0

? "Value written to the registry"

Endif


_________________________
Today is the tomorrow you worried about yesterday.

Top
#172453 - 2007-01-06 02:53 AM Re: How to add item to the Registry? [Re: ClarkKent]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11586
Loc: CA
You can't do that with a normal user logon script unless your users have local admin rights. Those keys are restricted from being updated by a user on purpose as they are POLICIES which control things.

You would have to use a GPO or similar method.

.

Top
#172454 - 2007-01-06 03:02 AM Re: How to add item to the Registry? [Re: NTDOC]
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
Doc, it states HKEY_CURRENT_USER\Software\Policies\Microsoft, what sublevel isn't writable by the user there ( in case I've missed something ) ?
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#172457 - 2007-01-06 03:35 AM Re: How to add item to the Registry? [Re: Björn]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
The Policies subkey has restricted rights even in HKCU.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#172473 - 2007-01-06 08:27 PM Re: How to add item to the Registry? [Re: Les]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
You can either create your own GPO policy file for this or use an admin script and remote registry writes to add the value.
_________________________
There are two types of vessels, submarines and targets.

Top
#172477 - 2007-01-06 10:22 PM Re: How to add item to the Registry? [Re: Sealeopard]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11586
Loc: CA
You can't do a remote registry add to the HKCU Jens unless you do some mods on the system.
Top
#172478 - 2007-01-06 10:25 PM Re: How to add item to the Registry? [Re: NTDOC]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
What mods? Just go through HKU\SID\...
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#172479 - 2007-01-07 01:06 AM Re: How to add item to the Registry? [Re: Les]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11586
Loc: CA
Yes you're correct Les, but rarely see anyone code it that way.
Top
#172480 - 2007-01-07 01:58 AM Re: How to add item to the Registry? [Re: NTDOC]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Actually, you will see that often where ASE is used with alternate creds. ASE was thoughtful enough to pass an enviro var of the true path of HKCU.

The cheap and dirty way if rolling out a reg hack en masse, is to enum all the loaded user hives and update them all.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

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 60 anonymous users online.
Newest Members
Brack, SpaceJunk, canandan, cfvrr, sarojaa
17694 Registered Users

Generated in 0.036 seconds in which 0.011 seconds were spent on a total of 14 queries. Zlib compression enabled.

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