Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - replace registry entry

Reply
 
Old 12-22-2008   #1 (permalink)
Allj


 
 

replace registry entry

Hi
I am relatively new to vbs. I want to find and change all instances of
a CLSID in the "HKEY_CLASSES_ROOT" of the registry. Can I use wildcard
* for the keys? I am unsure of the best way to loop thru the registry
and the exact language to replace the CLSID's. Any help is much
appreciated. Alan

My System SpecsSystem Spec
Old 12-24-2008   #2 (permalink)
mr_unreliable


 
 

Re: replace registry entry

Allj wrote:
Quote:

> I want to find and change all instances of
> a CLSID in the "HKEY_CLASSES_ROOT" of the registry. Can I use wildcard
> * for the keys? I am unsure of the best way to loop thru the registry
> and the exact language to replace the CLSID's. Any help is much
> appreciated. Alan
hi Alan,

I do registry-searches-and-fixes, but I don't use the
usual recommendations you will find here: i.e., the
(scripting) regread/write, or the WMI registry class.

I use regedit. First off, I dump the registry to a
temp file, like this:

oShell.Run "regedit /e /a " & sRegDump, , True

' note: the /a enables export as Ansi for WinXP

That gives me everything in the registry, as a text file.

Then I can search "the registry" (the text) using a normal
text search (which I find easier than directly searching
the registry.

To make changes, I again use regedit. I make up a text
file with the changes, and give it a "reg" (reg file)
extension. You can google reg file to get the details
of what it should look like, but here is an example:

--- <reg file example> ---
REGEDIT4
; repair net framework registry entries, jw 19Oct06
; ------------------------------------------------

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Components\FE0B727870194D115A24000972A8B18B]
"0C2E8944F1F80D14DA3B0CB0E234FF95"="c:\\WINDOWS\\Microsoft.Net\\FrameworkSDK_v1.0.2204\\Lib\\libcmtd.pdb"

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Components\9E0B727870194D115A24000972A8B18B]
"0C2E8944F1F80D14DA3B0CB0E234FF95"="c:\\WINDOWS\\Microsoft.Net\\FrameworkSDK_v1.0.2204\\Lib\\libcmt.pdb"

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Components\CE0B727870194D115A24000972A8B18B]
"0C2E8944F1F80D14DA3B0CB0E234FF95"="c:\\WINDOWS\\Microsoft.Net\\FrameworkSDK_v1.0.2204\\Lib\\libcd.pdb"

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Components\6E0B727870194D115A24000972A8B18B]
"0C2E8944F1F80D14DA3B0CB0E234FF95"="c:\\WINDOWS\\Microsoft.Net\\FrameworkSDK_v1.0.2204\\Lib\\libc.pdb"

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Components\E817A37130464D115AF3000972A8B18B]
"0C2E8944F1F80D14DA3B0CB0E234FF95"="c:\\WINDOWS\\Microsoft.Net\\FrameworkSDK_v1.0.2204\\Bin\\al.exe"

[HKEY_LOCAL_MACHINE\Software\Microsoft\COMPlus]
"sdkInstallRoot"="c:\\WINDOWS\\Microsoft.Net\\FrameworkSDK_v1.0.2204\\"

[HKEY_LOCAL_MACHINE\Software\Microsoft\COMPlus]
"sdkSamplesRoot"="c:\\WINDOWS\\Microsoft.Net\\FrameworkSDK_v1.0.2204\\Samples"
--- <end reg sample> ---

N.B. That "REGEDIT4" key word applies to win98, and for NT,XP,Vista
I believe the keyword is "REGEDIT".

Anyway, as you can see, the "data" in the reg file consists of
the "hive" information (i.e., where to place the data), and then
the actual registry entries you wish to insert.

This may sound more complicated that it is in reality.

Finally, I use shell.run to run regedit again, with the reg file
as a parameter, to put the desired registry changes in place.

btw, I adapted the registry search I use from code by Bill James:

http://billsway.com/vbspage/

although if he could see what I have done with his code he would
most likely throw up, and completely disown any connection.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but, no guarantee
the answers will be applicable to the questions)
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Solved how to list particular entry from registry ??? General Discussion
registry entry missing!!! Vista General
Deleted Registry Entry Vista hardware & devices
Logic One entry in registry Vista General
deleting registry entry Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46