@echo off

rem Doku:
rem Organizes Start of Application PLMJobManger
rem JobServer and JobClient Computers can be startet via this script
rem 10.09.2014 J.Fes First Version
rem 11.11.2014 J.Fes Last Update default Start Times reduced
rem 10.12.2014 J.Fes Last Optimised
 cls
 set CmdCurRoot_DP=%~dp0
 set CmdCurRoot_DP=%CmdCurRoot_DP:~0,-1%

 set ProgKill_log_DP=%CmdCurRoot_DP%.Custom\_LogFiles
 if not exist "%ProgKill_log_DP%" md "%ProgKill_log_DP%"
 set ProgKill_log_DPNE=%ProgKill_log_DP%\NXManagerStopProcess_Log.txt

 rem #Doc: run JobManagerStartCustom.cmd to get JobMgr_RootL_DP
REM  if exist "%CmdCurRoot_DP%\JobManagerStartCustom.cmd" call "%CmdCurRoot_DP%\JobManagerStartCustom.cmd"



 rem #Doc: Setup Base Dirs
 set BinServer_DP=%CmdCurRoot_DP%\..\01-BinServer
 set BinPublic_DP=%CmdCurRoot_DP%

 call "%BinPublic_DP%\ColorSet.cmd" Reset

:Menu
 Echo --------------------------------------------------------------------------
 Echo Stop NXManager Process \\%ComputerName% [%Date% %Time%]
 Echo --------------------------------------------------------------------------
 Echo.
 Echo  S   = Stop Ugmnager Processes
 Echo  Q   = QUIT / Exit
 Echo.

 set doNext=
 set /P doNext="please select option: "

 if /I "%doNext%"=="Q" Exit /B
 if /I "%doNext%"=="S" call :NXProcess_Stop
goto :Menu

goto :eof

rem ============================================================================
:NXProcess_Stop
  rem 07.05.2012 15:24 J.Fes Stopt alle JobClient Processe
  Call "%BinPublic_DP%\ProgKill.cmd" ugraf                 "%ProgKill_log_DPNE%" "5"
  Call "%BinPublic_DP%\ProgKill.cmd" perl                  "%ProgKill_log_DPNE%" "5"
  Call "%BinPublic_DP%\ProgKill.cmd" VisFastStart          "%ProgKill_log_DPNE%" "5"
REM   Call "%BinPublic_DP%\ProgKill.cmd" PLMJobManagerWatchDog "%ProgKill_log_DPNE%" "1"
goto :eof

