How to use WMIC.EXE for remote registry access

G

Guest

Hi, i try to create a batch file with WMIC.EXE to create/delete registry keys
on remote machines and found no example or any usable documentation about
that (only that it should be possible, but no example or needed command line
parameters).

I'm aware of many VB scripts at scriptcenter / technet, but nothing with
WMIC.EXE. Unfortunatly my boss isn't willing to accept VB, as an alternativ
only a Perl-script.

Does anybody have experience with this kind of usage of WMIC.EXE ?
Thanks, Hans
 
D

David Candy

Most people haven't because there is a very easy way to do it. Type reg /?. You get to specify the machine AND key.


REG QUERY KeyName [/v ValueName | /ve] [/s]

KeyName [\Machine\]FullKey
Machine - Name of remote machine, omitting defaults to the current machine
Only HKLM and HKU are available on remote machines
FullKey - in the form of ROOTKEY\SubKey name
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey - The full name of a registry key under the selected ROOTKEY
/v query for a specific registry key
ValueName - The name, under the selected Key, to query
if omitted, all values under the Key are queried
/ve query for the default value or empty value name <no name>
/s queries all subkeys and values
 
G

Guest

Hello David,

thank you very much for your info. I could solve the problem with this tip.
I have to admit, that i checked the REG program before, but didn't recognized
the remote computer support :-(

Btw, the WMIC.EXE is very poorly documented, especially with the registry
handling.

Many thanks, Hans

David Candy said:
Most people haven't because there is a very easy way to do it. Type reg /?. You get to specify the machine AND key.


REG QUERY KeyName [/v ValueName | /ve] [/s]

KeyName [\Machine\]FullKey
Machine - Name of remote machine, omitting defaults to the current machine
Only HKLM and HKU are available on remote machines
FullKey - in the form of ROOTKEY\SubKey name
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey - The full name of a registry key under the selected ROOTKEY
/v query for a specific registry key
ValueName - The name, under the selected Key, to query
if omitted, all values under the Key are queried
/ve query for the default value or empty value name <no name>
/s queries all subkeys and values
--
--------------------------------------------------------------------------------------------------
How to lose a war in Iraq
http://webdiary.com.au/cms/?q=node/1335#comment-48641
=================================================
Hans said:
Hi, i try to create a batch file with WMIC.EXE to create/delete registry keys
on remote machines and found no example or any usable documentation about
that (only that it should be possible, but no example or needed command line
parameters).

I'm aware of many VB scripts at scriptcenter / technet, but nothing with
WMIC.EXE. Unfortunatly my boss isn't willing to accept VB, as an alternativ
only a Perl-script.

Does anybody have experience with this kind of usage of WMIC.EXE ?
Thanks, Hans
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top