PDA

View Full Version : Cleaning Windows registry through Linux command line interface



s3a
December 29th, 2012, 06:41 AM
Is it possible to remove unused registry entries in a Windows installation by using the CLI in Linux? For example, when one uninstalls a program, not everything is removed from the Windows registry. If it's possible, how can make it so that everything that is unused is removed? My goal is to have a script that automates this hence the command line requirement.

Any input would be greatly appreciated!

PaulM1985
December 29th, 2012, 12:03 PM
Why use linux CLI? It seems to be a job much more suited to actually be done in Windows.

ofnuts
December 29th, 2012, 02:14 PM
Is it possible to remove unused registry entries in a Windows installation by using the CLI in Linux? For example, when one uninstalls a program, not everything is removed from the Windows registry. If it's possible, how can make it so that everything that is unused is removed? My goal is to have a script that automates this hence the command line requirement.

Any input would be greatly appreciated!
- How can you tell a registry entry is "unused". AFAIK There is no "last access timestamp" for these.
- See http://commandwindows.com/reg.htm for .BAT. if you use python there is also a _winreg (2.7) or winreg (3.x) module: http://docs.python.org/2/library/_winreg.html

cwsnyder
December 29th, 2012, 03:34 PM
I have seen more damaged Windows installations caused by BAD registry 'cleaner' type programs than I have seen Windows installations helped by registry cleaners. The ONLY cleaners which I have had good, consistent results from is the registry cleaning portion of Piriform's CCleaner, or Glarysoft's Glary Utilities run from within Windows.

s3a
December 29th, 2012, 04:12 PM
Thanks for the replies but, I haven't encountered any problems with registry cleaners before and, I really want to get this done in Linux if possible.

Will the winreg module allow me to modify the registry of a Windows installation on one hard drive by using a Linux installation on another hard drive? I have a feeling that it won't natively but, what if I run it using wine?

cwsnyder
December 29th, 2012, 10:24 PM
As I recall, there was mention of 'fixing' or at least restoring a backup of the registry in the instructions for the System Rescue CD. You might try there.

Habitual
December 29th, 2012, 10:59 PM
Is it possible to remove unused registry entries in a Windows installation by using the CLI in Linux?...

If they are unused, why are you wanting to remove them?
Wine won't work.

Your best bet is to export the hive of any keys you are interested in, edit them in a safe environment such as Linux, and re-import the hive back into the target host's Registry.

fyfe54
December 30th, 2012, 01:20 AM
+1 for CCleaner.

I have used it for years without incident - It has a feature that allows you to backup your registry changes just in case you have to undo them. I have never had to.