A. Leading on from my previous FAQ about installing based on architecture version, the next requirement was to only install the agent if it weren't already installed. This can be achieved in a number of ways, but the easiest was to just look for the DPM client user interface executable and, if found, skip the entire batch file.

To do this, just use

if exist <file> goto <label>:

If you want to do something if a file doesn't exist, use

if not exist <file> goto <label>:

My updated agent installation script became:

@echo off<br> echo Checking for DPM agent<br> if exist "C:\Program Files\Microsoft Data Protection Manager\DPM\bin\DPMClientUI.exe" goto EXIT<br><br> echo Detecting OS processor type<br><br> if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto 64BIT<br> echo 32-bit OS<br> \\savdaldpm01\ProtectionAgents\RA\3.0.7558.0\i386\DPMAgentInstaller_x86 /q<br> goto SETSERV<br><br> :64BIT<br> echo 64-bit OS<br> \\savdaldpm01\ProtectionAgents\RA\3.0.7558.0\amd64\DPMAgentInstaller_x64 /q <br><br> :SETSERV<br> "C:\Program Files\Microsoft Data Protection Manager\DPM\bin\setdpmserver.exe" -dpmservername savdaldpm01.savilltech.net<br><br> :EXIT