Check out the example below
Save (use notepad) the bolded text below with a .bat extension . Call the .bat file from command prompt.
@echo off
if not exist "C:\Program Files\MS\myClient" goto INSTALL
ECHO UNINSTALLING MY CLIENT
msiexec /x myClient.msi /qn
ECHO UNINSTALLATION COMPLETE
goto INSTALL
:INSTALL
ECHO INSTALLING MY CLIENT
msiexec /i myClient.msi /qn
ECHO INSTALLATION COMPLETE
Save (use notepad) the bolded text below with a .bat extension . Call the .bat file from command prompt.
@echo off
if not exist "C:\Program Files\MS\myClient" goto INSTALL
ECHO UNINSTALLING MY CLIENT
msiexec /x myClient.msi /qn
ECHO UNINSTALLATION COMPLETE
goto INSTALL
:INSTALL
ECHO INSTALLING MY CLIENT
msiexec /i myClient.msi /qn
ECHO INSTALLATION COMPLETE