@echo off title uninstall loading started color 0a echo ===================================================================== echo uninstall loading started echo ===================================================================== set DIR=%1 set JAVA_HOME=%DIR%\jdk1.8 set MYSQL_HOME=%DIR%\mysql set 4DKK_HOME=%DIR%\CGAII set REDIS_HOME=%DIR%\redis set MONGODB_HOME=%DIR%\mongodb echo stop-lasermongodb for /f "skip=3 tokens=4" %%i in ('sc query lasermongodb') do set "zt=%%i" &goto :next :next if /i "%zt%"=="RUNNING" ( if exist %DIR%\USER_DATA ( %MONGODB_HOME%\bin\mongodump --host 127.0.0.1 --port 29031 --gzip --out %DIR%\USER_DATA\mon ) net stop lasermongodb taskkill /f /im mongod.exe if "%errorlevel%"=="0" ( echo service stop )else ( echo service stop err ) ) else ( echo service no start ) sc delete lasermongodb cd /d %~dp0 echo stop-lasermysql for /f "skip=3 tokens=4" %%i in ('sc query lasermysql') do set "zt=%%i" &goto :next :next if /i "%zt%"=="RUNNING" ( if exist %DIR%\USER_DATA ( %MYSQL_HOME%\bin\mysqldump.exe -P3307 -u root -plaser laser > %DIR%\USER_DATA\lite.sql md %DIR%\USER_DATA\static\ md %DIR%\USER_DATA\pro\ xcopy /y /s /f /h %DIR%\4DKK_PROGRAM_STATIC\* %DIR%\USER_DATA\static xcopy /y /s /f /h %DIR%\4DKK_PROGRAM_DATA\* %DIR%\USER_DATA\pro ) net stop lasermysql && %MYSQL_HOME%\bin\mysqld.exe -remove lasermysql && rd /s /Q %MYSQL_HOME%\data taskkill /f /im mysqld.exe if "%errorlevel%"=="0" ( echo service stop )else ( echo service stop err ) ) else ( echo service no start ) sc delete lasermysql echo stop-laserredis for /f "skip=3 tokens=4" %%i in ('sc query laserredis') do set "zt=%%i" &goto :next :next if /i "%zt%"=="RUNNING" ( net stop laserredis if "%errorlevel%"=="0" ( echo service stop )else ( echo service stop err ) ) else ( echo service no start ) sc delete laserredis set pathStr=%path% wmic environment where "name='FDMGEA_HOME'" delete wmic environment where "name='MYSQL_HOME'" delete wmic environment where "name='REDIS_HOME'" delete wmic environment where "name='4DKK_HOME'" delete wmic environment where "name='MONGODB_HOME'" delete wmic environment where "name='JAVA_HOME'" delete wmic environment where "name='CLASS_PATH'" delete setlocal enableDelayedExpansion ping -n 3 127.1>nul