logic checks on regestry keys

  • Thread starter Thread starter a w
  • Start date Start date
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.
 
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.
|
|
 
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.
|
|
 
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
 
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
 
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
 
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
 
Back
Top