Ah, very nice Matt!
Thanks for both replies guys.
Matt Stachoni
|>On Sat, 31 Jan 2009 00:24:30 +0000, James Maeding
|>wrote:
|>
|>>in my login script, which is a .cmd file, I want to do something based on if a particular registry entry exists.
|>>Is there a way to do this?
|>>
|>>I was thinking of making a tool to create a text file in some folder if the entry exists, then use IF EXIST
|>>(...) in my batch file.
|>
|>I use REG QUERY in conjunction with the ERRORLEVEL system variable.
|>
|>For example, let's say I want to uninstall Autodesk DWG TrueConvert. I would see
|>if it is installed by querying the Install key for that product, then if
|>ERRORLEVEL is 0 (i.e., it is intalled,) I would uninstall it:
|>
|>@echo off
|>set pth=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
|>
|>echo Checking/Removing Autodesk DWG TrueConvert...
|>reg query "%pth%\{5783F2D7-0221-0409-0000-0060B0CE6BBA}"
|>if %errorlevel%==0 msiexec.exe /x{5783F2D7-0221-0409-0000-0060B0CE6BBA} /passive
|>
|>Matt
|>matt@stachoni.com
James Maeding
Civil Engineer and Programmer
jmaeding - at - hunsaker - dotcom