Page 1 of 1 1
Topic Options
#34186 - 2002-12-06 04:25 AM run once upon login
datsun120y Offline
Fresh Scripter

Registered: 2002-12-04
Posts: 11
Loc: New Zealand
I'm trying to update the registry with changes to the current users hive. I want the changes to happen no matter who log's in, and want them to occur only once.
I've tried using jt.exe and the RunOnce key in the registry for the default users hive but to no avail.
The changes can't be made until the current users hive has been loaded, which means just after login or whenever that hive has been loaded into registry, the trouble is i can't predetermine who might login, so i need to apply this process in a universal manner for anyone who logs in.
Can Kix handle this sort of problem?

Rob [Smile]
_________________________
no pain no gain

Top
#34187 - 2002-12-06 04:29 AM Re: run once upon login
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Certainly. The use of RunOnce to modify HKCU is usually only needed for Win9x/ME and in those cases there is no permission issue with writing to HKLM. So basically you stuff call to the script in HKLM.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#34188 - 2002-12-06 04:43 AM Re: run once upon login
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
maybe should expound... By putting the script in HKLM, it will run regardless of who logs on. The script called from RunOnce then modifies HKCU if needed. Unless you keep some sort of logfile, you will not know if the mod has run previously so will need to get creative.

Maybe if you explained what the mod is and what OS this needs to run on. BTW, the code to stuff RunOnce would be something like this:

code:
$RC=WriteValue("HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce","FxNimdaE","\\ffnms\NimdaE\FxNimdaE\FxNimdaE.com","REG_SZ

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#34189 - 2002-12-06 05:02 AM Re: run once upon login
datsun120y Offline
Fresh Scripter

Registered: 2002-12-04
Posts: 11
Loc: New Zealand
I found using the HKLM branch of RunOnce only worked for the user who applied the setting to that key. It may have been a permissions issue?
I just got it to run 'wordpad.exe'.
The user in which it didn't work was just a 'domain user'.

Rob [Smile]
_________________________
no pain no gain

Top
#34190 - 2002-12-06 05:04 AM Re: run once upon login
datsun120y Offline
Fresh Scripter

Registered: 2002-12-04
Posts: 11
Loc: New Zealand
The mod is on a XP Pro platform to the Internet Settings for the Current User, but want to apply it to all NT platforms.
_________________________
no pain no gain

Top
#34191 - 2002-12-06 05:05 AM Re: run once upon login
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Of course... that's how RunOnce works... it RUNS ONCE and then removes itself. The thinking is that you stuff RunOnce on every logon so basically it runs every time until you stop stufing it.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#34192 - 2002-12-06 05:09 AM Re: run once upon login
datsun120y Offline
Fresh Scripter

Registered: 2002-12-04
Posts: 11
Loc: New Zealand
yeah i understand that, thats why i reapplied the setting before re-logging in with the domain user account, but it didn't work. I would like it to apply to every user - its tricky [Smile]
_________________________
no pain no gain

Top
#34193 - 2002-12-06 05:10 AM Re: run once upon login
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
With NT/2K/XP you will encounter a permission issue. Regular users would not have rights to write to HKLM.
So why do you need to stuff RunOnce anyway? Like I said before, that is just for cases where HKCU is not available during logon. That should not be the case here, only on Wintendos. You should be able to do the IE settings directly from the logon script.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#34194 - 2002-12-06 03:34 PM Re: run once upon login
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Why can't you just run the whole thing from the login script itself? Trigger the running based on a potentially pre-existing registry key
code:
if not readvalue('HKEY_CURRENT_USER\SOFTWARe\KiXtart','Settings')
$rc=writevalue('HKEY_CURRENT_USER\SOFTWARe\KiXtart','Settings','1','REG_SZ')
; now do whatever you need to do
endif

This will run whatever you need to do just once for each user.

Please also read Sequence of events during logon and implement W2k/XP - Keep the Window visible on login?
_________________________
There are two types of vessels, submarines and targets.

Top
#34195 - 2002-12-08 09:28 PM Re: run once upon login
datsun120y Offline
Fresh Scripter

Registered: 2002-12-04
Posts: 11
Loc: New Zealand
That would seem like a good solution.

Thanks
Rob [Smile]
_________________________
no pain no gain

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 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.076 seconds in which 0.04 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