@echo on

echo 正在重启BS-Plant系统服务......


d:
cd BS-Plant

sc query PMIS_Task >nul
if errorlevel 1060 (goto noexist) else (goto exist)

:exist

net stop PMIS_Task
bin\PMIS_Task.exe /uninstall /silent
goto noexist

:noexist

net stop PMIS_MySQL
mysql\bin\mysqld.exe -remove PMIS_MySQL

taskkill /F /IM PMIS_Fpm.exe > nul
taskkill /F /IM PMIS_Nginx.exe > nul
taskkill /F /IM PMIS_Task.exe > nul
taskkill /F /IM php-cgi.exe > nul

PMIS_Csl.exe bin/PMIS_Fpm.exe
PMIS_Csl.exe nginx/PMIS_Nginx.exe -p nginx

mysql\bin\mysqld.exe --install PMIS_MySQL
net start PMIS_MySQL

bin\PMIS_Task.exe /install /silent
net start PMIS_Task
