diff options
| author | chenjinsong <[email protected]> | 2018-09-27 16:17:06 +0800 |
|---|---|---|
| committer | chenjinsong <[email protected]> | 2018-09-27 16:17:06 +0800 |
| commit | 9b3c3ac5d7828b348558012f6167527459310f21 (patch) | |
| tree | 4c8e31f5445ae85b8100e1e7e2f1cba28fca9136 /wininstall/script/writepid.bat | |
Diffstat (limited to 'wininstall/script/writepid.bat')
| -rw-r--r-- | wininstall/script/writepid.bat | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/wininstall/script/writepid.bat b/wininstall/script/writepid.bat new file mode 100644 index 0000000..4d4c4a0 --- /dev/null +++ b/wininstall/script/writepid.bat @@ -0,0 +1,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 |
