![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Guest | Search Registry value and change value data Hi, I need a big help.... I need a script to Search all the registry for a value for ex: sTimeFormat and change its value data, for ex, h:m:ss by hh:mm:ss The sTimeFormat value may be several times in all registry... can you help me please? |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: Search Registry value and change value data That's a big job. You probably want to use the StdRegProv object from WMI. If you don't know about that then look it up on Google. StdRegProv provides a set of functions you can use. There's EnumKey and EnumValues that you can use to read the Registry. You'll need to use those in a recursive routine. You can then use SetStringValue to make the changes. VBScript has easier methods in the WScript.Shell object (RegRead, RegWrite) but there are no enumeration functions there, so you need StdRegProv. Also, WMI must be installed, and the WMI service be running, in order to use StdRegProv. Quote: > > I need a big help.... I need a script to > > Search all the registry for a value for ex: sTimeFormat and change its > value data, for ex, h:m:ss by hh:mm:ss > > The sTimeFormat value may be several times in all registry... > > can you help me please? |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: Search Registry value and change value data Solved: I found this http://www.billsway.com/vbspage/Show...es/RegSrch.txt And modify -> Option Explicit Dim oWS : Set oWS = CreateObject("WScript.Shell") Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject") Dim sSearchFor sSearchFor = "sThousand" Dim sRegTmp, sOutTmp, eRegLine, sRegKey, aRegFileLines sRegTmp = oWS.Environment("Process")("Temp") & "\RegTmp.tmp " sOutTmp = "test.txt" oWS.Run "regedit /e /a " & sRegTmp, , True '/a enables export as Ansi for WinXP With oFSO.GetFile(sRegTmp) aRegFileLines = Split(.OpenAsTextStream(1, 0).Read(.Size), vbcrlf) End With oFSO.DeleteFile(sRegTmp) For Each eRegLine in aRegFileLines If InStr(1, eRegLine, "[", 1) > 0 Then sRegKey = eRegLine If InStr(1, eRegLine, sSearchFor, 1) > 0 Then sRegKey = Replace(sRegKey, "[", "") sRegKey = Replace(sRegKey, "]", "") oWS.RegWrite sRegKey & "\" & sSearchFor, "." End If Next Erase aRegFileLines |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Registry Search Tool... Cleaning Up Vista Registry... | Vista General | |||
| Add to DevicePath Data in registry | .NET General | |||
| Registry and data types | PowerShell | |||
| could not update registry data? | Vista General | |||
| could not update registry data? | Vista General | |||