Page 1 of 1 1
Topic Options
#4112 - 2000-09-14 04:15 PM Writevalue to Currentversion/explorer/shell folders ?!?!
Anonymous
Unregistered


Hi!

I'm trying to create a roaming profile thing without the usual nt server stuff. I created a home directory for my users. Now, i'd like to set the registry values under
HKEY_CURRENT_USER\software\microsoft\windows\currentversion\Explorer\Shell Folders.

I tried to set the desktop value to point to a directory on the user's home directory. During testing the script works perfectly. It sets the desktop value to the required folder. BUT! During the login process it just does not work! The user logs in, sripts runs without an error, but the registry is not changed, everything is set to the default values.
Here is the code that i'm using:


$result = WriteValue ("HKEY_CURRENT_USER\software\microsoft\windows\currentversion\Explorer\Shell Folders","Desktop","h:\desktop","REG_SZ")

h: is the home dir.

As I said this works if it's not called from the login script.

Any ideas???

I'm new to kixtart so please excuse my lack of knowledge:).

Thanx in advance!

Top
#4113 - 2000-09-14 04:46 PM Re: Writevalue to Currentversion/explorer/shell folders ?!?!
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
amarok:

You have to write to this key for the desktop pointer to stick:

$result = WriteValue ("HKEY_CURRENT_USER\software\microsoft\windows\currentversion\Explorer\User Shell Folders","Desktop","h:\desktop","REG_SZ")

The "User Shell Folders" value gets "copied" to the "Shell Folders" value at logon time.

Shawn.


Top
#4114 - 2000-09-15 07:40 AM Re: Writevalue to Currentversion/explorer/shell folders ?!?!
Anonymous
Unregistered


Thanks Shawn!!!

I just figured it out after I posted the question.

BTW, why is "$result = " is necesarry?

Top
#4115 - 2000-09-15 02:14 PM Re: Writevalue to Currentversion/explorer/shell folders ?!?!
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
$result= is needed - big time !

The writevalue() function always returns an error code (actually all "functions" return an error code). If you don't specify $result=, this code gets written to your console.

This makes for some interesting effects, especially if you have one of these functions in a loop...


c:\> kix32 script.kix
0000000000000000000000000000000000000

I personally use this...

$= writevalue()

or this...

$rs = writevalue()

But others do this...

$nul = writevalue()
$q = writevalue()
$result = writevalue()

Doesn't really matter what you use, the effect is the same !

Shawn.

Top
#4116 - 2000-09-18 03:54 PM Re: Writevalue to Currentversion/explorer/shell folders ?!?!
Anonymous
Unregistered


Shawn does this apply for 9x too?
I'm having the same problem but the above didn't work

Top
#4117 - 2000-09-18 04:11 PM Re: Writevalue to Currentversion/explorer/shell folders ?!?!
Anonymous
Unregistered


Oops, oh yes it does.

Must format UNC path correctly....

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
1 registered (Allen) and 781 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.05 seconds in which 0.023 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