Solved

Registry Refresh...?

Posted on 2003-10-28
11
958 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 9

Author Comment

by:DrWarezz
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 8

Expert Comment

by:K_2K
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now