Solved

Registry Refresh...?

Posted on 2003-10-28
11
964 Views
Last Modified: 2009-03-04
hey all,
I am hoping that it is possible to reload the registry settings via a batch file (or atleast uploading a few alterations) without having to reboot?

For example:
with the registry editing software, FreshUI, there are many alterations you can make to the registry (which make system changes), many of these changes take affect instantly, without you having to reboot.
Is this possible to do via a batch file?

As, I can make an alteration to the registry easily via a batch file, but have to reboot before it does anything! :(

Does anyone know how to solve my problem?

Regards,

>>Rob:D<<
0
Comment
Question by:DrWarezz
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 8

Expert Comment

by:K_2K
ID: 9636057
reg.exe is on XP, or free download from MS.  Use this to read how it works:

reg /?
reg query /?
reg add /?

Much Carefullness is strongly advized.


Good Luck,
2K
(\o/)
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 9637245
hey K_2K (& any one else),

Thanks, but I already know how to alter the registry via Batch/DOS.

My problem is:
After I make an alteration, I must reboot the computer for it to take affect. Is it possible to have a registry alteration take affect to the system without having to reboot?
(e.g: a command or something, which reloads the registry to the OS... [without a reboot])

(I hope I've rephrased it a bit better.)

Regards,

>>Rob:D<<
0
 
LVL 5

Expert Comment

by:juliancrawford
ID: 9638296
I have heard of one possible solution to this issue.
After the changes have been made to the registry if you stop and restart explorer.exe the registry changes will take affect.
If you can get your batch file to kill explorer.exe and the launch explorer.exe you could have a fix.
:)
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 9

Author Comment

by:DrWarezz
ID: 9641612
hey Julian,
your solution works, thanks.

The only problem now is:
stopping and then restarting explorer.exe via a batch!?

I'm sure tht:
start c:\windows\explorer.exe
will restart it.

But, stopping it is another story. Also: by stopping explorer.exe, would this end the batch file which is supposed to restart it?

Thanks so far...

Regards,

>>Rob:D<<
0
 
LVL 8

Accepted Solution

by:
K_2K earned 100 total points
ID: 9641912
All changes done in the registry are instant, regardless of using regedit, regedt32, reg, or regini.

They all save changes to "the hives" the same way.  If you make a change in regedit that instantly makes a difference, the same change from batch instantly makes a difference.

As Julian correctly points out, some programs choose to set some values when they start and not check those in the registry again.  In those cases a utility like FreshUI or the one you are building needs to both do the registry change AND restart the programs that use it.  tlist.exe and kill.exe, both free from MS downloads can help with that.

Other settings can be prooven instant without restarting any program.
This is fun, (and usefull):
Right-click the start button and tap the x key a few times.  The menu items that x is a shortcut for are alternately highlighted.  (Some older systems don't have "Explore all users", so the x will instead immediately open explorer at the start menu)  You almost have to look to see which one is lit before you can press enter to make it happen, no big deal.
Now click "Start", "Run", paste the following line in, and press enter.  
     reg add "HKEY_CLASSES_ROOT\Folder\shell\explore" /ve /d "Explore&-"
Now when you right-click the start button, the - key immediately explores your start menu, and the x key immediately explores the "all users" start menu.  No more looking needed, mouse optional. [Start] [Esc] [Shift+F10] [-]

For those looking on who don't have reg.exe, the same above works in regedit, navigating to [HKEY_CLASSES_ROOT\Folder\shell\explore] and setting the default value to "Explore&-" (without the quotes).  You can see the change before you close the registry, the instant you click "ok" for that value.

So now we know why MS takes SO LOONNG to open that tiny little right-click "context menu".  It re-reads a large portion of registry every time we ask it to draw that thing.  The second time we open it, it still reads it all, but unchanged blocks of the hive are in memory cache, so it's faster.

My 2¢,
2K
(\o/)
0
 
LVL 8

Expert Comment

by:K_2K
ID: 9641942
But, stopping it is another story. Also: by stopping explorer.exe, would this end the batch file which is supposed to restart it?

No,  Explorer started cmd.exe to control the batch, and does not keep track of it as a child process.

2K
(\o/)
0
 
LVL 2

Expert Comment

by:ChrisDrake
ID: 9648011
I do not think this is possible.

It depends on the particulare code that is using the registry values as to how it handles the change of those values.  Most things should work OK if you shut down the program in question, change the registry, then re-start the program.

Services are probably different - they load their settings when they start, and they don't bother to check the registry again while running, so unless you use their own interfaces to change things, they are never going to notice?
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 9649501
Hey K_2K, Chris and Julian,

Thanks for all your input. I see that there isn't much luck for me to do what I originally wanted, but it doesnt' matter. Thanks alot anyway.

Regards,

>>Rob:D<<
0
 
LVL 2

Expert Comment

by:ChrisDrake
ID: 9650506
It should be relatively easy to find a program which can kill explorer.exe for you: so if you have a look around for this thing, you will probably have your answer?

From a programming point of view - it's only half a dozen lines of code to find and restart it, so something this trivial must already exist someplace.
0
 
LVL 8

Expert Comment

by:K_2K
ID: 9652557
kill -f  Explorer.EXE  

But I,m guessing his problem is more related to restricted area of the registry or a setting his adminsitrator has not authorized his userid to make.

Regards,
2K
(\o/)
0
 
LVL 2

Expert Comment

by:ChrisDrake
ID: 9654302
Ahh - so thats how you do that.

He *did* say this earlier tho (wrt killing explorer):-

>hey Julian,
>your solution works, thanks.
>The only problem now is:
>stopping and then restarting explorer.exe via a batch!?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question