Set MsiName=PKGID-VENDOR-APPLICATION_NAME-VERSION-1.0.msi Set UPN=PKGID-VENDOR-APPLICATION_NAME-VERSION-1.0 Set LogFolder="C:\SWDLogs\%UPN%_Install.log" if not exist "C:\SWDLogs" md "C:\SWDLogs" msiexec.exe /i "%~dp0%MsiName%" /qb-! /l*v %LogFolder% set insterror=%errorlevel% if %insterror%==0 goto :Misc if %insterror%==1641 goto :Misc if %insterror%==3010 goto :Misc goto :ERROR :Misc @echo Successfully Installed APPLICATION_NAME goto :Einde :ERROR @echo Error Code is %insterror%if exist %LogFile% type %LogFile% goto :Einde :Einde @echo Job ended at %date% %Time% Exit %insterror%