![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | Script to Export Multiple registry values? I am trying to export the Following Keys: "HKEY_LOCAL_MACHINE\SOFTWARE\VERITAS\NetBackup\CurrentVersion\Config\Browser" "HKEY_LOCAL_MACHINE\SOFTWARE\VERITAS\NetBackup\CurrentVersion\Config\Client_Name" "HKEY_LOCAL_MACHINE\SOFTWARE\VERITAS\NetBackup\CurrentVersion\Config\Server" To a reg file so that i can Import it on another machine. I have been doing this with a batch file to export them to their own reg file then import all 3 later. I would really like to just use VBS, which I am slowly learning. Can anyone give a hand? thank you - Ryan |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Script to Export Multiple registry values? Ryan schreef: Quote: > I am trying to export the Following Keys: > "HKEY_LOCAL_MACHINE\SOFTWARE\VERITAS\NetBackup\CurrentVersion\Config\Browser" > > "HKEY_LOCAL_MACHINE\SOFTWARE\VERITAS\NetBackup\CurrentVersion\Config\Client_Name" > > "HKEY_LOCAL_MACHINE\SOFTWARE\VERITAS\NetBackup\CurrentVersion\Config\Server" > > To a reg file so that i can Import it on another machine. > I have been doing this with a batch file to export them to their own reg > file then import all 3 later. > I would really like to just use VBS, which I am slowly learning. > Can anyone give a hand? > thank you > > - Ryan no VBS needed you can do it with: C:\WINDOWS> REG.EXE /EXPORT HKLM\SOFTWARE\VERITAS\NetBackup\CurrentVersion\Config somefile.reg or type "REG EXPORT /?" for more help... -- Luuk |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Script to Export Multiple registry values? "Ryan" <djcalvin@xxxxxx> wrote in message news:O3oeiIaAKHA.4004@xxxxxx Quote: >I am trying to export the Following Keys: > "HKEY_LOCAL_MACHINE\SOFTWARE\VERITAS\NetBackup\CurrentVersion\Config\Browser" > "HKEY_LOCAL_MACHINE\SOFTWARE\VERITAS\NetBackup\CurrentVersion\Config\Client_Name" > "HKEY_LOCAL_MACHINE\SOFTWARE\VERITAS\NetBackup\CurrentVersion\Config\Server" > To a reg file so that i can Import it on another machine. > I have been doing this with a batch file to export them to their own reg > file then import all 3 later. > I would really like to just use VBS, which I am slowly learning. > Can anyone give a hand? > thank you > > - Ryan with a batch file because you must take care of the five possible types of registry values that exist: - Reg_SZ - Reg_Expand_SZ - Reg_Binary - Reg_DWord - Reg_Multi_SZ The following script is an example of how it could be done. It comes from here: http://www.microsoft.com/technet/scr....mspx?mfr=True Const HKCR=&H80000000, HKCU=&H80000001, HKLM=&H80000002, HKUS=&H80000003 Const REG_SZ = 1 Const REG_EXPAND_SZ = 2 Const REG_BINARY = 3 Const REG_DWORD = 4 Const REG_MULTI_SZ = 7 Const strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Setup" Set oReg = GetObject("winmgmts:\\.\root\default:StdRegProv") oReg.EnumValues HKLM, strKeyPath, arrEntryNames, arrValueTypes For i = 0 To UBound(arrEntryNames) WScript.Echo "Name: " & arrEntryNames(i) Select Case arrValueTypes(i) Case REG_SZ oReg.GetStringValue HKLM, strKeyPath, arrEntryNames(i),strValue WScript.Echo "String=" & strValue Case REG_EXPAND_SZ oReg.GetExpandedStringValue HKLM, strKeyPath, arrEntryNames(i), estrValue WScript.Echo "Expanded String=" & estrValue Case REG_BINARY oReg.GetBinaryValue HKLM, strKeyPath, arrEntryNames(i),arrValues Line = "" For Each byteValue In arrValues Line = Line & byteValue Next WScript.Echo "Binary=" & Line Case REG_DWORD oReg.GetDWORDValue HKLM, strKeyPath, arrEntryNames(i),dwValue WScript.Echo "DWORD=" & dwValue Case REG_MULTI_SZ oReg.GetMultiStringValue HKLM, strKeyPath, arrEntryNames(i), arrValues Line = "" For Each strValue In arrValues Line = Line & strValue & vbLf Next WScript.Echo "Multi String=" & Line End Select Next |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Set/Create Registry Values | PowerShell | |||
| Remote HKU registry values | PowerShell | |||
| Reporting on registry values | PowerShell | |||
| Export-Csv multiple hashtable values | PowerShell | |||
| need some registry values | Vista General | |||