logic checks on regestry keys

A

a w

Hello Everyone,

I want to write a simple batch file to do logic checks against the registry.

I don't want to modify the registry in anyway, just to a check and then
based on that condition, execute another part of the batch file.

Is this possible?

Thank you in advance.
 
D

Dave Patrick

Use the RegRead method of VBScript. Get the documentation here.
http://www.microsoft.com/downloads/...48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Hello Everyone,
|
| I want to write a simple batch file to do logic checks against the
registry.
|
| I don't want to modify the registry in anyway, just to a check and then
| based on that condition, execute another part of the batch file.
|
| Is this possible?
|
| Thank you in advance.
|
|
 
D

Dave Patrick

Use the RegRead method of VBScript. Get the documentation here.
http://www.microsoft.com/downloads/...48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Hello Everyone,
|
| I want to write a simple batch file to do logic checks against the
registry.
|
| I don't want to modify the registry in anyway, just to a check and then
| based on that condition, execute another part of the batch file.
|
| Is this possible?
|
| Thank you in advance.
|
|
 
V

Vincent Fatica

Can't I do this without VBscript?

You could do it in a C/C++ program with the Reg* family of functions.

JPSoft's "4NT" and "TakeCommand" command interpreters have built-in
registry-reading functions that could be used in batch files.

There's a Microsoft utility called REG.EXE. It has been around a while and
I don't recall exactly where is (maybe some Resource Kit). It allows
reading the registry from a CMD command line. Here's the top-level help
message for REG.EXE.

Console Registry Tool for Windows - version 3.0
Copyright (C) Microsoft Corp. 1981-2001. All rights reserved


REG Operation [Parameter List]

Operation [ QUERY | ADD | DELETE | COPY |
SAVE | LOAD | UNLOAD | RESTORE |
COMPARE | EXPORT | IMPORT ]

Return Code: (Except of REG COMPARE)

0 - Succussful
1 - Failed

For help on a specific operation type:

REG Operation /?

Examples:

REG QUERY /?
REG ADD /?
REG DELETE /?
REG COPY /?
REG SAVE /?
REG RESTORE /?
REG LOAD /?
REG UNLOAD /?
REG COMPARE /?
REG EXPORT /?
REG IMPORT /?

Here's an example of its use:

v:\> reg query HKCU\Environment /v home

! REG.EXE VERSION 3.0

HKEY_CURRENT_USER\Environment
home REG_SZ d:\home
 
V

Vincent Fatica

Can't I do this without VBscript?

You could do it in a C/C++ program with the Reg* family of functions.

JPSoft's "4NT" and "TakeCommand" command interpreters have built-in
registry-reading functions that could be used in batch files.

There's a Microsoft utility called REG.EXE. It has been around a while and
I don't recall exactly where is (maybe some Resource Kit). It allows
reading the registry from a CMD command line. Here's the top-level help
message for REG.EXE.

Console Registry Tool for Windows - version 3.0
Copyright (C) Microsoft Corp. 1981-2001. All rights reserved


REG Operation [Parameter List]

Operation [ QUERY | ADD | DELETE | COPY |
SAVE | LOAD | UNLOAD | RESTORE |
COMPARE | EXPORT | IMPORT ]

Return Code: (Except of REG COMPARE)

0 - Succussful
1 - Failed

For help on a specific operation type:

REG Operation /?

Examples:

REG QUERY /?
REG ADD /?
REG DELETE /?
REG COPY /?
REG SAVE /?
REG RESTORE /?
REG LOAD /?
REG UNLOAD /?
REG COMPARE /?
REG EXPORT /?
REG IMPORT /?

Here's an example of its use:

v:\> reg query HKCU\Environment /v home

! REG.EXE VERSION 3.0

HKEY_CURRENT_USER\Environment
home REG_SZ d:\home
 
D

Dave Patrick

It's really not that difficult. Check the documentation or as Vincent
mentioned reg.exe from the support tools folder on your Windows 2000 install
CD-Rom.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Can't I do this without VBscript? My VBscript knowledge is non-existant
 
D

Dave Patrick

It's really not that difficult. Check the documentation or as Vincent
mentioned reg.exe from the support tools folder on your Windows 2000 install
CD-Rom.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Can't I do this without VBscript? My VBscript knowledge is non-existant
 

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