summaryrefslogtreecommitdiff
path: root/wininstall/script/writepid.bat
blob: 4d4c4a085eaa8fefaed37bb13ec95003f4d12fa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@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