Page 1 of 1
How to check for installed softwares in a system
Posted: 01 Feb 2010 23:19
by krisamigo
How to Create a batch file for checking the
1. Sql server express is installed or not
2. Dot net frame work 3.5 is installed or not
3. J# redistributable package is installed or not
Thanks in advance,
Regards
Re: How to check for installed softwares in a system
Posted: 02 Feb 2010 14:15
by aGerman
krisamigoThere are different approaches.
If it is a registered software you could have a look to your registry (HKEY_LOCAL_MACHINE\SOFTWARE) to figure out if a software is installed. See also
http://www.dostips.com/DtCodeCmdLib.php#Function.IsRegKey.
Otherwise you could look for a special exe file or folder. E.g.
Code: Select all
@echo off &setlocal
set "dotNETpath=%SystemRoot%\Microsoft.NET\Framework\v3.5"
if exist "%dotNETpath%" (
echo Dot net frame work 3.5 is installed.
) else (
echo Dot net frame work 3.5 not found.
)
pause
Regards
aGerman
Re: How to check for installed softwares in a system
Posted: 02 Feb 2010 22:48
by krisamigo
Hi aGerman
Thanks a ton for your reply
I want to check with registry values
if you dont mind can you assist me how to check with regiestry as i am not understood with the URL which is given
Awaiting for your reply.
Thanks
Re: How to check for installed softwares in a system
Posted: 03 Feb 2010 06:46
by sxekjb
I've had most success querying for installed software by going through hklm\software\microsoft\windows\currentversion\uninstall
This has a list of installed software and keys that give info on the displayname,version, install location etc.
try using the reg command and output the results. IE
Code: Select all
REG QUERY \\machine\hklm\software\microsoft\windows\currentversion\uninstall >>output.log
Re: How to check for installed softwares in a system
Posted: 03 Feb 2010 07:39
by aGerman
krisamigosxekjb is right, this is also a possible solution.
The first you have to do is allways searching for a meaningful key in the registry. Use any registry editor (e.g. regedit.exe).
If you want to use the function of my url:
Code: Select all
@echo off &setlocal
call :IsRegKey "HKLM\SOFTWARE\Adobe\Acrobat Reader" &&(
echo Acrobat Reader is intalled.
)||(
echo Acrobat Reader is Not intalled.
)
pause
goto :eof
::~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:IsRegKey Key -- succeeds if Key exists
:: -- Key [in] - registry key
:$created 20060101 :$changed 20080219 :$categories Registry
:$source http://www.dostips.com
reg query "%~1">NUL 2>NUL
EXIT /b
The return of the function is something like TRUE or FALSE (errorlevel is 0 or greater than 0).
This example is for "Acrobat Reader". Of couse you have to replace and append the function calls with your keys.
Regards
aGerman
Re: How to check for installed softwares in a system
Posted: 03 Feb 2010 23:26
by krisamigo
Hi aGerman
Marvelous
Thanks a ton
i am breaking my head to use Req Query command with your suggestion it serves my requirement
Thanks once again
Besk of luck
Regards