@echo off
SET PROG="c:YourServiceLocationService.exe" SET FIRSTPART=%WINDIR%"Microsoft.NETFrameworkv" SET SECONDPART="InstallUtil.exe" SET DOTNETVER=4.0.30319 IF EXIST %FIRSTPART%%DOTNETVER%%SECONDPART% GOTO install
GOTO fail :install ECHO Found .NET Framework version %DOTNETVER% ECHO Installing service %PROG% %FIRSTPART%%DOTNETVER%%SECONDPART% %PROG% GOTO end :fail echo FAILURE -- Could not find .NET Framework install :param_error echo USAGE: installNETservie.bat [install type (I or U)] [application (.exe)] :end ECHO DONE!!! Pause