xfilz
Members-
Posts
6 -
Joined
-
Last visited
Reputation
0 NeutralAbout xfilz

-
Changing rkey and rvalue works fine, nice work!!! But if there are spaces inbetween words, values are gone... Can anyone please explain why? BoX? Well I found a workaround, but the above code would be easier to use... @echo off setlocal set rkey=HKEY_LOCAL_MACHINE\SYSTEM\Setup\Pid set rvalue="Pid" set regexe=%SystemRoot%\System32\Reg.exe for /f "Skip=4 Tokens=3" %%a in ('%regexe% QUERY "%rkey%" /v %rvalue%') do (set rdata=%%a) set regfile=".\my_tst.reg" echo REGEDIT4>%regfile% echo.>>%regfile% echo [%rkey%]>>%regfile% echo %rvalue%^="%rdata%">>%regfile% echo.>>%regfile% ################################################ set rkey=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion set rvalue1="CurrentVersion" for /f "Skip=4 Tokens=3" %%a in ('%regexe% QUERY "%rkey%" /v %rvalue1%') do (set rdata1=%%a) echo.>>%regfile% echo [%rkey%]>>%regfile% echo %rvalue1%^="%rdata1%">>%regfile% echo.>>%regfile% ################################################ set rvalue2="ProductId" for /f "Skip=4 Tokens=3" %%a in ('%regexe% QUERY "%rkey%" /v %rvalue2%') do (set rdata2=%%a) echo.>>%regfile% echo [%rkey%]>>%regfile% echo %rvalue2%^="%rdata2%">>%regfile% echo.>>%regfile% ################################################# Regedit /a .\temp.txt "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" Find "RegisteredOrganization" < .\temp.txt >> .\RegisteredOrganization.reg Find "RegisteredOwner" < .\temp.txt > .\RegisteredOwner.reg Find "ProductName" < .\temp.txt >> .\ProductName.reg Find "CSDVersion" < .\temp.txt >> .\CSDVersion.reg Find "BuildLab" < .\temp.txt >> .\BuildLab.reg ################################################# regedit /a .\dump_MountedDevices.reg "HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices" copy my_tst.reg+RegisteredOrganization.reg+RegisteredOwner.reg+ProductName.reg+CSDVersion.reg+BuildLab.reg+dump_MountedDevices.reg alldump.reg del my_tst.reg RegisteredOrganization.reg RegisteredOwner.reg ProductName.reg CSDVersion.reg BuildLab.reg dump_MountedDevices.reg temp.txt tmp.txt endlocal JSI Tip 2750. How do I export a REGEDIT4 .REG file using Windows 2000, from a command line or batch? I had some trouble with REGEDIT4 vs. REGEDIT5 and merging .reg files but regedit /a solved it... xfilz
-
Wow, I couldnt find the solution anywhere myself, I tried this and it works perfect! To make it also include the following values is even more awsome: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion] values "SubVersionNumber"="" "CurrentBuild"="" "InstallDate"= "ProductName"="" "RegDone"="" "RegisteredOrganization"="" "RegisteredOwner"="" "SoftwareType"="" "CurrentVersion"="" "CurrentBuildNumber"="" "BuildLab"="" "CurrentType"="" "CSDVersion"="" "SystemRoot"="" "SourcePath"="" "PathName"="" "ProductId"="" "DigitalProductId"= "LicenseInfo"= I suspect its too difficult for me, but getting one "RegisteredOwner" value is huge surprise to me its possible:D
-
Thank you very much, very nice of you! Another thing I cant find anywhere... Is it possible to do the 'opposite' thing, for instance if you export [HKEY_CURRENT_USER\Printers] and the only value you want is the "DeviceOld"="xxxxxx" in the .reg file, without other subkeys and values like [HKEY_CURRENT_USER\Printers\Connections], is it possible?
-
Is it possible to get a .cmd thing to do the same job? My Norton AntiVirus keeps reporting all similar .vbs as '''Malicious script detected''' ''FileSystem Object'' -Activity: 'CreateTextFile'... ???
-
YES! Thank you, it finally works, the main problem was other OS language, seeing your edits and trying a few different alternatives - its now GOOD! '=================== Set objShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") arrRegPaths = Array( _ "HKEY_CURRENT_USER\Environment\", _ "HKEY_CURRENT_USER\SessionInformation\", _ "HKEY_CURRENT_USER\Volatile Environment\", _ "HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices\", _ "HKEY_LOCAL_MACHINE\SYSTEM\Select\", _ "HKEY_LOCAL_MACHINE\SYSTEM\Setup\" _ ) Const intForReading = 1 Const intUnicode = -1 strFileName = objShell.ExpandEnvironmentStrings(".\") & ".\RegKeys.reg" Set objRegFile = objFSO.CreateTextFile(strFileName, True, True) objRegFile.WriteLine "Windows Registry Editor Version 5.00" For Each strRegPath In arrRegPaths strCommand = "cmd /c REG EXPORT " & strRegPath & " " & Replace(strRegPath, "\", "_") & ".reg" objShell.Run strCommand, 0, True If objFSO.FileExists(Replace(strRegPath, "\", "_") & ".reg") = True Then 'WScript.Sleep 1000 ' Wait one second to give the file time to close Set objInputFile = objFSO.OpenTextFile(Replace(strRegPath, "\", "_") & ".reg", intForReading, False, intUnicode) If Not objInputFile.AtEndOfStream Then objInputFile.SkipLine objRegFile.Write objInputFile.ReadAll End If objInputFile.Close Set objInputFile = Nothing objFSO.DeleteFile Replace(strRegPath, "\", "_") & ".reg", True End If Next objRegFile.Close Set objRegFile = Nothing MsgBox "Finished." '=================== THANX BoX xfilz
-
I have multiple registry keys I like to export and append to one .reg file, instead of several .reg files that can be imported back into the registry. This is my newbie "multiple into one.reg.cmd" example project: reg export "HKEY_CURRENT_USER\Environment" .\dump_Environment.reg reg export "HKEY_CURRENT_USER\SessionInformation" .\dump_SessionInformation.reg reg export "HKEY_CURRENT_USER\Volatile Environment" .\dump_Volatile_Environment.reg reg export "HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices" .\dump_MountedDevices.reg reg export "HKEY_LOCAL_MACHINE\SYSTEM\Select" .\dump_Select.reg reg export "HKEY_LOCAL_MACHINE\SYSTEM\Setup" .\dump_Setup.reg It's a bit similar to a problem I found here, but the script is no good/faulty to me: VBS script to export multiple registry keys and append to one .reg file : Microsoft, Windows XP Professional, Microsoft Registry Editor v5.1, VB S Anyone have knowledge on how to merge/append my example into a better "multiple into one.reg.cmd" that fully automates the outcome to one .reg file? thanx multiple into one.reg.cmd.txt
