REG EXPORT REG QUERY???

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
tinfanide
Posts: 117
Joined: 05 Sep 2011 09:15

REG EXPORT REG QUERY???

#1 Post by tinfanide » 07 Aug 2012 22:10

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]

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: REG EXPORT REG QUERY???

#2 Post by Ed Dyreen » 07 Aug 2012 22:44

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.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: REG EXPORT REG QUERY???

#3 Post by foxidrive » 08 Aug 2012 00:41

reg import works with the exported file, doesn't it?

Post Reply