Check If Program Is Installed Batch

Posted on by

Hey, Here is the scenario: You have to remote in to users computers, verify they have all the required programs on your list and make sure they are all updated to the specified version. If they don't have the program or it's not updated then you must install it for them. My solution: Thought it would be easy to create a folder and put inside all the installation directories for the potentially needed programs along with a batch file, then zip that folder up and host it on the web somewhere. When remoted to users computer it would then be as simple as downloading and extracting the zip file and running the batch file to check install and update all the needed software. This code hasn't actually been used yet so has some placeholder info that would need replacement (when testing randomly chose some installed software)::: Initialize batch settings and clear old program version check run files if they exist @echo off SETLOCAL ENABLEDELAYEDEXPANSION If Exist c: prog.txt Del c: prog.txt If Exist c: installer-check.txt Del c: installer-check.txt:: Read registry for installed programs, use this to setup regedit /e c: regexport.txt 'HKEY_LOCAL_MACHINE Software Microsoft Windows CurrentVersion Uninstall' echo STOP HERE unless batch file has already been setup.

Check If Program Is Installed Batch

Echo To setup rest of batch file open c: regexport to find the display name and version of installed programs. Echo Do this on a computer with all the wanted software already installed and at latest version. Echo If this has already been setup then continue with program.

I need to be able to run this batch fine on both x86 and x64 machines to check if a program has been installed correctly. We have an app that installs in x86 in the standard program files directory, and when installed in x64 it installs in the x86 program files directory.

Currently it reports false, displays the echo that the app is installed and the echo that the app is not installed when run on x86 and x64. If /i '%processor_architecture%'=='x86' GOTO X86DC if /i '%processor_architecture%'=='X64' GOTO X64DC:X86DC if exist 'C: Program Files installeddir app.exe' ( echo ***App is Installed Successfully*** ) if not exist 'C: Program Files installeddir app.exe' ( echo ***App is not installed *** ):X64DC if exist 'C: Program Files(x86) installeddir app.exe' ( echo ***App is Installed Successfully*** ) if not exist 'C: Program Files(x86) installeddir app.exe' ( echo ***App is not installed*** ). Wouldn't something like this be clearer?

Polderbit Sound Recorder Crack. Windows has the program start.exe which somehow knows how to. Driver Audio Sony Vaio Pcg-7f1m Version 2.0. Detecting if a program is installed and where using cmd. Same thing can be done from batch file.

Also eliminates the issue of making assumptions about the processor_architecture variable pointed out by @MBu above. If defined ProgramFiles(x86) ( set appDir=%ProgramFiles(x86)% installeddir ) else ( set appDir=%ProgramFiles% installeddir ) if exist%appDir% app.exe ( echo We're installed in%appDir%. ) else ( echo Nope. Not installed. ) Another alternative that just now occurs to me would be for your installation program or batch file to write a key to the registry with the installation location (can be done with reg.exe, a standard Windows utility).

I'd be happy to flesh that solution out a bit more if you're interested. When run on x86, your script will execute both code blocks: for x86 and x64. You have to insert goto:eof just before:x64dc label or add another label (say:end) at the end of the script and insert goto end just before:x64dc label Another problem is the value of%processor_architecture% variable. My machine (Windows 7 x64) returns AMD64, not X64.

So in my case neither of if instructions results in a jump, so again both code blocks are executed. See for a list of all possible%processor_architecture% values.

Comments are closed.