PC Review


Reply
Thread Tools Rate Thread

Checking a Registry Key Value

 
 
=?Utf-8?B?UGhpbG8=?=
Guest
Posts: n/a
 
      26th Apr 2006
Doe anyone know how I can check if a key value in the registry is a specific
value. I would like to check that the "Display name" is "Microsoft Office
Standard Edition 2003"
for
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{90120409-6000-11D3-8CFE-0150048383C9}
I know how to display it but I don't know how to check for this specific
value.. I believe Visio is installed with the same key and I want to
differentiate between the products for an office rollout project I am
working on. Thanks!

 
Reply With Quote
 
 
 
 
Mark V
Guest
Posts: n/a
 
      26th Apr 2006
In microsoft.public.win2000.registry =?Utf-8?B?UGhpbG8=?= wrote:

> Doe anyone know how I can check if a key value in the registry
> is a specific value. I would like to check that the "Display
> name" is "Microsoft Office Standard Edition 2003"
> for
> HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9012040
> 9-6000-11D3-8CFE-0150048383C9} I know how to display it but I
> don't know how to check for this specific value.. I believe
> Visio is installed with the same key and I want to differentiate
> between the products for an office rollout project I am working
> on. Thanks!


Perhaps REG.EXE and FIND.EXE?

(using shorter example)

C:\>reg query "HKEY_CURRENT_USER\Console\CMD" /v "FaceName"
Errorlevel will be 0 if valuename found. 1 otherwise.

Next step (where the FaceName = "Terminal")

C:\>reg query "HKEY_CURRENT_USER\Console\CMD" /v "FaceName" | FIND.EXE "FaceName"
FaceName REG_SZ Terminal

C:\>echo %errorlevel%
0


C:\>reg query "HKEY_CURRENT_USER\Console\CMD" /v "FaceName" | FIND.EXE "FaceZZZZ"

C:\>echo %errorlevel%
1

IF %errorlevel% EQU 0 echo/ Found expected data.

There are of course other methods but this is simple and can be
run in a batch file.

REG.EXE is either shipped in the OS or in the Support Tools (W2K) or
Resource Kit. Recall that various MS applications install under
different "ID"s. "Microsoft Visio 2000" here for example stores it's
"DisplayName" under \{DBFA7530-0CBF-11D3-8CC0-00C04F72C04D}\

 
Reply With Quote
 
Jerold Schulman
Guest
Posts: n/a
 
      27th Apr 2006
On Wed, 26 Apr 2006 09:57:02 -0700, Philo <(E-Mail Removed)> wrote:

>Doe anyone know how I can check if a key value in the registry is a specific
>value. I would like to check that the "Display name" is "Microsoft Office
>Standard Edition 2003"
> for
>HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{90120409-6000-11D3-8CFE-0150048383C9}
>I know how to display it but I don't know how to check for this specific
>value.. I believe Visio is installed with the same key and I want to
>differentiate between the products for an office rollout project I am
>working on. Thanks!



In a batch, Using <B>REG.EXE</B>, built into Windows XP, Windows Server 2003, and later operating systems, or installed from the
Windows 2000 Support Tools:


set key=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{90120409-6000-11D3-8CFE-0150048383C9}
set DspName=Not Found
for /f "Tokens=2*" %%a in ('reg query %key% /V DisplayName^|Find "REG_SZ"') do (
set DspName=%%b
)
if /i "%DspName%" NEQ "Microsoft Office Standard Edition 2003" goto NotMSOSE2K3


Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking for a registry value... =?Utf-8?B?am9uZWZlcg==?= Microsoft ASP .NET 3 30th Sep 2006 03:58 AM
Checking registry =?Utf-8?B?cG9wcHk=?= Microsoft VC .NET 1 23rd Jan 2006 11:36 AM
Checking a key in the Registry? gsb58@hotmail.com Microsoft VB .NET 3 9th Sep 2005 11:52 AM
Registry checking software news.microsoft.com Windows XP Performance 3 3rd Jun 2005 07:32 PM
Checking Registry Don Windows XP Basics 1 22nd May 2004 06:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:54 AM.