This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
nms-nmsserver/wininstall/script/writepid.bat
2018-09-27 16:17:06 +08:00

33 lines
883 B
Batchfile

@ECHO OFF
rem ---------------------------------------------------------------------------
rem Write PID Script for the the DATADONTROLLER
rem ---------------------------------------------------------------------------
set "PRG_DIR=%~dp0"
if not "%DC_HOME%" == "" goto gotHome
set "DC_HOME=%PRG_DIR%"
if exist "%DC_HOME%\bin\DataController.exe" goto okHome
cd /d %PRG_DIR%\..
set "DC_HOME=%cd%"
cd "%PRG_DIR%"
:gotHome
if exist "%DC_HOME%\bin\DataController.exe" goto okHome
echo The DC_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome
if not exist "%DC_HOME%\temp" (
cd %DC_HOME%
mkdir temp
cd %DC_HOME%\script
)
set "_NAME=DataController.exe"
wmic process where name="%_NAME%" get processId |findStr /v "ProcessId" |findstr /v "findstr" >"%DC_HOME%\temp\DataControllerPid.temp"
:end
exit 0