Sign in to follow this  
Followers 0
BPBNA

Registry changes not taking effect on restart?

11 posts in this topic

#1 ·  Posted (edited)

Hey guys,

The company I work at has two scripts that we run on new laptops. The scripts are attached below. The ClientConfig is what we run when we get the computer to setup the location, username, and computer name. It sets the NewUser file to run at startup. This file is supposed to change the settings for any new user that logs on. In this script, I have it change the ShellState key so that it should display the classic start menu but NOT force it.

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer", "ShellState", "REG_BINARY", "2400000030280000000000000000000000000000010000000D0000000000000000000000")

For some reason, even though after the ClientConfig reboots the computer, and the NewUser file runs, then reboots again, it doesnt seem to set it to the classic start menu, it stays on the XP one. If I set the EnableBalloonTips key to 1, then I can run the NewUser file again(since it checks that key to see if it should run or not). After I run it the SECOND time and let it reboot, only THEN will the start menu change to the classic start menu.

Any ideas why it wouldnt take effect the first time it is run?

ClientConfig.au3 NewUser.au3

Edited by BPBNA

Share this post


Link to post
Share on other sites



I know I've run in to this before on a few computers I had to set up manually. I change the Start Menu to Classic, do a few other tweaks (like getting rid of the animated dog when doing file/folder search). Then after I reboot, the Start Menu is back to the XPStartPanel. I change the Start Menu a second time, and then it sticks.

So I don't think you are doing anything wrong because I have had the same problem with completely manual setups....


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

So does anyone know a way around it aside from rewriting the script so it runs twice?

Share this post


Link to post
Share on other sites

So does anyone know a way around it aside from rewriting the script so it runs twice?

There must be some sort of reset or refresh that needs to happen. This example might be more simplistic, but when you use the registry to change the name of the "My Computer" icon but you have to refresh the screen (F5) to get the change to show. There must be something to refresh or reset after making the Start Menu chages too...maybe. Like changing display settings in the registry as opposed to using display properties.

Try running a system watch program that shows all the files accessed then do the changes through windows to see what shows up.

I ran Filemon from the sysinternals website http://www.sysinternals.com. It shows quite a few things going on switching from Classic to the WinXP Startmenu and very few things going on when switching from WinXP to Classic.

Here is a tip on this I found http://www.windowsitpro.com/Article/Articl...22060.html?Ad=1 . I tried this tip by stopping explorer.exe and restarting it and it worked but maybe there is another less intrusive solution.


Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

Share this post


Link to post
Share on other sites

The refresh would be the restart. As far as I know, all registry settings are reread at startup. The thing is even if I check the registry key, it still shows the Shellstate as being set for the XP start menu, even though running the script a second time changes it.... this really makes no sense to me

Share this post


Link to post
Share on other sites

The refresh would be the restart. As far as I know, all registry settings are reread at startup. The thing is even if I check the registry key, it still shows the Shellstate as being set for the XP start menu, even though running the script a second time changes it.... this really makes no sense to me

I know a restart would do it but when you change it in windows using the start menu properties, it doesn't do a PC restart. I mean something like a .dll routine you can call or something like that.

You could try ending and restarting the explorer.exe process mentioned in the previous post link. I just haven't messed with doing that in AutoIt and I'm not sure how invasive that option is. I tried it on my PC with a few apps open and they weren't affected.

As far as why your selection doesn't change even after a reboot, I just don't know on that.


Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

Share this post


Link to post
Share on other sites

As far as why your selection doesn't change even after a reboot, I just don't know on that.

In my case, I was actively using the classic start menu and it reverted upon the very first reboot. (My setting always stuck the second time, though.) I wonder if temporarly changing the permissions on that registry key (deny all) before rebooting would help.

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

When makin the wall paper changer in my sig i used a Dll call to SystemParametersInfo in User32.dll, the call i used was to set the wall paper but im pretty sure you can alter other settings using a combination of this and registry changes. The Dllcall in makes the wall paper change go into effect when the user clicks the button and makes the change permanent for the next time the user logs on. I think this could solve the problem.


_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Share this post


Link to post
Share on other sites

There doesnt seem to be anything in that dll that would modify the start menu. :D

If anyone else knows what function or dll to use to do that, if it is possible, I'd love to know.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

The only two root keys that are saved to disk are the HKEY_Users & HKEY_Local_Machine. The others are recreated from links (to HKEY_Users & HKEY_Local_Machine) at startup. Therefore, it would seem that to enable a "first time" reboot & "works like it should", one should make their changes to key values within these two base groups.

See Jerry Honeycutt's Windows XP Registry Guide for more information. Specific information on interrelations between major key groups are diagrammed on page 22, fig. 1-6. Great book to have around for all sorts of Windows issues.

Rich

Edited by setirich

Good intentions will always be pleaded for every assumption of authority. It is hardly too strong to say that the Constitution was made to guard the people against the dangers of good intentions. There are men in all ages who mean to govern well, but they mean to govern. They promise to be good masters, but they mean to be masters.-Daniel Webster

Share this post


Link to post
Share on other sites

I have seen this also, and wondered of a solution. One other thing that I have seen do is the desktop cleanup. You click on the nag baloon to close it, and in a few seconds, it pops back up again. The second time you close it, it sticks. I suspect there is a list of items that require a "second" click to close. But then again, what do I know. :whistle:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0