Pulling back data from a key that has mult sub keys

  • Thread starter Thread starter Golding
  • Start date Start date
G

Golding

I am written a batch file using NT shell scripting and reg.exe. When
query the registry for the status in a package installed under
Hklm\software\microsoft\sms\mobile client\software
distribution\execution history\system\"packageid"\[,,] there are to
key [] under this packageid,one is for th install and one is for
another prodinstall. I need to query for the install but not sure how
to read both [,,] to get the correct information. Current commend
using reg query "hklm\software\microsoft\sms\mobile client\software
distribution\execution history\system\%pkgid%" \\%machine% > Temp2.txt
 
reg query "hklm\software\microsoft\sms\mobile client\software
distribution\execution history\system\%pkgid%" \\%machine% > Temp2.txt

reg query /?
shows the help file. You might be interested in /s-parameter.

Ciao, Walter
 
In said:
I am written a batch file using NT shell scripting and reg.exe.
When query the registry for the status in a package installed
under Hklm\software\microsoft\sms\mobile client\software
distribution\execution history\system\"packageid"\[,,] there are
to key [] under this packageid,one is for th install and one is
for another prodinstall. I need to query for the install but not
sure how to read both [,,] to get the correct information. Current
commend using reg query "hklm\software\microsoft\sms\mobile
client\software distribution\execution history\system\%pkgid%"
\\%machine% > Temp2.txt

Check that reg.exe is ver 2.0 (or greater) and check the syntax.
If this is a local registry you do not need "\\machine" at all,
and if you did it would appear before the registry path.
Try reg query /? to check on that.
I am not very clear on what you have. Will you post some or all
of a REGEDIT4 export for clarity?
It seems you already know the "packageid" and have stored that
in %pkgid%. ? Reading (enumerating) the content, generally should
be straightforward as in
reg query "hklm\software\microsoft\sms\mobileclient\software distribution\execution history\system\%pkgid%"

If I am following, you need to do exactly that to see the two sub-keys
in the output ("one level"). adding "/s" will enulerate both the two keys,
and their content. "/s queries all subkeys and values"

Note on output: At least some versions of reg use HT (Tab) to align
the data. This can be bothersome if parsing the data.

Probably you should indicate your OS as this might matter.
 
Back
Top