Page 1 of 1

REG EXPORT REG QUERY???

Posted: 07 Aug 2012 22:10
by tinfanide
Suppose I've extracted the wanted registry keys:

Code: Select all

@ECHO OFF

REG QUERY HKLM /s /v WakeEnabled


The output:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{36FC9E60-C465-11CF-8056-444553540000}\0009
WakeEnabled REG_DWORD 0x0
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{36FC9E60-C465-11CF-8056-444553540000}\0011
WakeEnabled REG_DWORD 0x0
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Class\{36FC9E60-C465-11CF-8056-444553540000}\0009
WakeEnabled REG_DWORD 0x0
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Class\{36FC9E60-C465-11CF-8056-444553540000}\0011
WakeEnabled REG_DWORD 0x0
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{36FC9E60-C465-11CF-8056-444553540000}\0009
WakeEnabled REG_DWORD 0x0
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{36FC9E60-C465-11CF-8056-444553540000}\0011
WakeEnabled REG_DWORD 0x0
End of search: 6 match(es) found.


But how can I REG EXPORT them into the registry file format?
[/code]
REM obviously I've tried something like this but it seems not the suitable way

FOR /F "tokens=*" %%A IN ('REG QUERY HKLM /s /v WakeEnabled') DO (

)
[/code]

Re: REG EXPORT REG QUERY???

Posted: 07 Aug 2012 22:44
by Ed Dyreen
tinfanide wrote:Suppose I've extracted the wanted registry keys:

Code: Select all

@ECHO OFF

REG QUERY HKLM /s /v WakeEnabled

You can't use the /s option alongside the /v option. You either enumerate regkey/s or a single reg/value.
tinfanide wrote:But how can I REG EXPORT them into the registry file format?
[/code]
REM obviously I've tried something like this but it seems not the suitable way

FOR /F "tokens=*" %%A IN ('REG QUERY HKLM /s /v WakeEnabled') DO (

)
[/code]
For regKeys use

Code: Select all

reg export "hklm\software\..." regFile
For regVals reg export seems not an option.

Re: REG EXPORT REG QUERY???

Posted: 08 Aug 2012 00:41
by foxidrive
reg import works with the exported file, doesn't it?