Page 1 of 2 12>
Topic Options
#66549 - 2002-06-10 08:59 PM accept registry changes immediately
Anonymous
Unregistered


Hello KiX Users,

I am using a script to make changes to the registry. For example screensaver settings or Explorer view changes. But those are not accepted until the user logs into the system again.
I noticed that the SETx commands send a SW_SETTINGCHANGE to have the explorer re-read the settings.
My question is if there is a way within KiX to let that happen.

Thanks for your help.

Fabian Koehlmann

Top
#66550 - 2002-06-10 09:12 PM Re: accept registry changes immediately
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
What operating systems are you using? I'm thinking of a possible way to do this.. hmmm. If it's NT 4.0 or later, you should be able to use WMI to do this (theoretically) using the Win32_Desktop Class... nevermind.. the properties are read only.. logging off and back on works.. lemme think.. I'll come up with something..

Brian

[ 10 June 2002, 21:17: Message edited by: BrianTX ]

Top
#66551 - 2002-06-10 09:39 PM Re: accept registry changes immediately
Anonymous
Unregistered


I am using NT based systems. NT4, 2k, XP Pro.

Thx for fast response...

Top
#66552 - 2002-06-10 09:44 PM Re: accept registry changes immediately
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Some things are better set by policy.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#66553 - 2002-06-10 11:42 PM Re: accept registry changes immediately
Anonymous
Unregistered


if you kill explorer.exe sleep 3 seconds and run explorer.exe again maybe it works (explorer is the default shell)
ps. absolute untested !

Top
#66554 - 2002-06-11 08:14 AM Re: accept registry changes immediately
Aaron.Power Offline
Lurker

Registered: 2002-06-11
Posts: 1
When working interactively in Windows, the way to have these changes picked up immediately after you change the registry values by hand is to click somewhere on the desktop (so that it has the focus) and then press the F5 key (Refresh).

Not sure that this helps in a scripting situation. You have the SetFocus command and the SendKeys command, but I am not sure how you would get it to set the focus to the desktop, as the desktop does not usually live in the "Window List".

Still it is a lot less drastic than killing the root Explorer process and then re-loading it.

Top
#66555 - 2002-06-11 09:12 AM Re: accept registry changes immediately
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Re-Initialize Your Registry Without Rebooting
http://www.winguides.com/registry/display.php/239/

Restart Windows Without Rebooting
To restart Windows without restarting your computer, choose Shut Down from the Start menu and hold down the Shift key while pressing OK in the Shut Down box until "Now Restarting Windows" appears on the screen. Then release the Shift key

Top
#66556 - 2002-06-12 12:57 AM Re: accept registry changes immediately
Anonymous
Unregistered


Fabian Koehlmann Hello,

some apps can be reloading their registry setting by restarting the service that they are running under.

Mike

Top
#66557 - 2002-06-11 10:42 PM Re: accept registry changes immediately
Anonymous
Unregistered


Thanks,
for all your hints so far.
But neither of it works nor is acceptable to put into a login script except the policy one.

Does anyone of you know what command is executed after you changed settings within the windows explorer? Guess on english system it should be Tools/Folder Options (2k). When you press ok there? I think this is the routine I am looking for.
Can i be run by rundll.exe?!

Or using a dummy SETx command to have it re-read. Hopefully it reads most of the settings which were changed.

Regards, Fabian.

[ 11 June 2002, 22:45: Message edited by: Fabian Koehlmann ]

Top
#66558 - 2002-06-12 03:07 AM Re: accept registry changes immediately
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Fabian,

I don't think there is any other way without writing a utility in another language. I think this is a Win32 API call which KiXtart can not call directly.

Top
#66559 - 2002-06-12 02:53 PM Re: accept registry changes immediately
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
If you incorporate those registry changes as part of a login script, then the registry changes are made before the Explorer.exe is loaded (at least with RunLogonScriptSync=1). Or am I wrong on this one?
_________________________
There are two types of vessels, submarines and targets.

Top
#66560 - 2002-06-12 05:40 PM Re: accept registry changes immediately
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
I think you're right, Jens... There is something else you can do if you don't want users messing with your settings:

Under "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" Set the "NoSaveSettings" REG_DWORD to 1

That way everything goes back to normal after they log off (which will annoy a lot of people if they are used to having lots of control about their desktop!)

Brian

[ 12 June 2002, 17:50: Message edited by: BrianTX ]

Top
#66561 - 2002-06-14 12:49 AM Re: accept registry changes immediately
ash wilson (kyosei) Offline
Getting the hang of it

Registered: 2002-04-22
Posts: 58
Loc: auckland new zealand
A tip from member MyItGuy is ...

SetFocus("Program Manager")
SendKeys("{F5}")

Using NT/2000/XP your desktop settings such as wallpaper, tile, stretch etc. should be dynamic when changing registry values because USER environment is in place BEFORE login process is started, but Wintendo will need a forced refresh (as above) or second login because USER (HKCU)environment is not set in place until AFTER login process has finished.

Get around this by placing entry to run login script AFTER login process has finished into HKLM\...\RunOnce location.

rgds kyosei
_________________________
KYOSEI. There are only three groups of people that can count. Those that can, and those that can't.

Top
#66562 - 2002-06-13 01:00 PM Re: accept registry changes immediately
ash wilson (kyosei) Offline
Getting the hang of it

Registered: 2002-04-22
Posts: 58
Loc: auckland new zealand
Fabian,

In your initial post you said that changes were not taking place until user logged in a second time and later you said you were only using NT/2000/XP workstations.

This definitely does not seem right to me as it is more consistent with 9x/Me not NT.

What registry location are you using for say desktop wallpaper settings?
_________________________
KYOSEI. There are only three groups of people that can count. Those that can, and those that can't.

Top
#66563 - 2002-06-13 02:37 PM Re: accept registry changes immediately
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Let's not forget "runLogonScriptSync"
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#66564 - 2002-06-13 04:05 PM Re: accept registry changes immediately
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See my post, I also mention it in a little sidenote [Smile]
_________________________
There are two types of vessels, submarines and targets.

Top
#66565 - 2002-06-13 05:20 PM Re: accept registry changes immediately
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well, after that share vs. printer name thingy, figured better to err on the side of repetition. [Wink]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#66566 - 2002-06-13 06:14 PM Re: accept registry changes immediately
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
So, you're saying to set RunLogonScriptSync=1 as described in W2k - Keep the Window visible on login? [Big Grin]
_________________________
There are two types of vessels, submarines and targets.

Top
#66567 - 2002-06-13 07:19 PM Re: accept registry changes immediately
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
At the risk of repeating myself, it directs the system to wait for the logon script to finish running before it starts the Windows Explorer interface. The "visibility" is a side effect.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#66568 - 2002-06-13 07:24 PM Re: accept registry changes immediately
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Les: I know [Smile] I just thought I repeat it again, just to be on the really safe side.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 2 12>


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 641 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.107 seconds in which 0.063 seconds were spent on a total of 13 queries. Zlib compression enabled.

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