Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using reg query to find installed software?

Status
Not open for further replies.
Oct 15, 2002
153
0
0
US
I have a batch file login script I need to run to determine if a certain version of Java is installed during startup, and if not, install it.

I found references to using "reg query" statements, but for some reason I get get it to return true/false values based n the info I found.

the consensus I found was that a two line command such as:

reg query HKCU\Software\Winamp
if errorlevel 1 goto not_exist

when I try to put that into real world use, I dont get an errorlevel, I get a return of every entry under the key I am referencing.

for example, I input:
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F83216022FF}

and instead of getting the expected result code of 0 or 1, I get a list of all of the items under that key if it is installed, or a more verbose "ERROR: The system was unable to find the specified registry key or value." error. if it is not.

ideas? am I missing a switch somewhere?
 
See if your Syntax is correct, the second link might give a few clues for an alternate plan.

Querying keys

VBS Script Assistance
thread779-1206493

Can you make use of the java -version command? This is an example from my Command Prompt.

C:\Users\usernamexxxx>java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top