Help With Batch File
I am not good with batch file and need your help. I have current login script to install SCCM 2012 with these rules that somone on our team created but now he is out of the office for the next 2 weeks. I can't wait that long.
If exist %windir%\ccmsetup\ccmsetup.exe GOTO %AVSrvr%
If exist %windir%\system32\ccmsetup\ccmsetup.exe GOTO %AVSrvr%
If exist %windir%\CCM\CcmEval.exe GOTO %AVSrvr%
if %location%==VPN set location=HQDT
if %location%==Unknown set location=HQDT
if %location%==EUVPN set location=UK
Echo Please wait while SCCM 2012 is installing. This may take 2-4 minutes...
\\netapp-%location%\apps\sccm\SCCM_2012_Client\Install_SCCM_2012.exe
echo SCCM 2012 Client installation has finished...
goto %AVSrvr%
Is there a command that say "If this file (ccmsetup.exe) is running" goto %AVSrvr%?
Thanks,
Answers (2)
http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_27848083.html
Verified Answer
@echo on
tasklist /FI "USERNAME ne NT domain\%username%" /FI "STATUS eq running" /FI "IMAGENAME eq CPOPM06.exe" | find /i "CPOPM06.exe" && set PROCEXIST=YES
IF ERRORLEVEL 2 GOTO FoundCPS
IF ERRORLEVEL 1 GOTO StartCPS
:FoundCPS
goto EXIT
:StartCPS
start http://servername/centrici
goto EXIT
:EXIT
Exit