Reg QUERY command help???

C

Craig

I'm trying to use the Reg QUERY command in a batch file to
look for the following registry
key:HKLM\SYSTEM\ControlSet001\Services\dmio\Boot
Info\Primary Disk Group. (Note: The key should only exist
if the hard drive has been converted to a dynamic disk).
Here's my command: Reg QUERY HKLM\SYSTEM\ControlSet001
\Services\dmio\Boot Info\Primary Disk Group.
Unfortunately, the Reg command won't work because of the
SPACES in either Boot Info or Primary Disk Group! When the
batch file runs...it gives me an "Error: Too many command-
line parameters" How do I make the Reg command work with
the spaces??? Suggestions???
 
D

David Jones

Enclose the key in quotes, ex.

"HKLM\SYSTEM\ControlSet001\Services\dmio\BootInfo\Primary
Disk Group"
 
A

Alun Jones [MS MVP]

"Craig" said:
Unfortunately, the Reg command won't work because of the
SPACES in either Boot Info or Primary Disk Group! When the
batch file runs...it gives me an "Error: Too many command-
line parameters" How do I make the Reg command work with
the spaces??? Suggestions???

Is there a problem with using quotes?

Here's an example:

C:\>reg query hklm\software\texas imperial software

Error: Invalid command-line parameters

C:\>reg query "hklm\software\texas imperial software"

! REG.EXE VERSION 3.0

HKEY_LOCAL_MACHINE\software\texas imperial software

HKEY_LOCAL_MACHINE\software\texas imperial software\WFTPDPro

This seems to work.

Alun.
~~~~
 

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