@setlocal enabledelayedexpansion @echo off color f0 title 卸载指定服务 rem 下面为自定义参数可修改 set mysqlServiceName=MySQL7506 SC QUERY %mysqlServiceName% > NUL IF ERRORLEVEL 1060 GOTO NOTEXIST GOTO EXIST :NOTEXIST echo %mysqlServiceName% 服务不存在 GOTO END :EXIST net stop %mysqlServiceName% sc delete %mysqlServiceName%
taskkill /F /IM mysqld.exe GOTO END :end pause