#批处理打造MySQLCleaner
###1. 简介
在我们卸载MySQL数据库的时候,往往除了需要卸载软件,还需要删除各种注册表信息,隐藏文件,卸载服务,否则当我们再次安装MySQL时就会出现一些令人难以理解的错误。所以为了简单起见,本人用批处理简单写了一个清理软件,用于卸载MySQL后清理残余的任务,基本上是默认安装路径的都可以一键清除,如果有特殊情况,可参照百度经验完全卸载mysql数据库图文教程,然后停止并删除服务即可。
###2. 注意事项
请以管理员权限运行此程序!!
###3. 代码样例
TITLE MySQLCleaner
@echo off
color 0e
echo Start Delete MySQL Process
echo @Author PeterZ
echo.
echo ____ ___ _ ____ _
echo / ___^| / _ ^| ^| / ___^| ^| ^| ___ __ _ _ __ ___ _ __
echo \___ ^| ^| ^| ^| ^| ^| ^| ^| ^| ^| / _ / _` ^| ^| '_ / _ ^| '__^|
echo ___) ^| ^| ^|_^| ^| ^| ^|___ ^| ^|___ ^| ^| ^| __/ ^| (_^| ^| ^| ^| ^| ^| ^| __/ ^| ^|
echo ^|____/ \__\_ ^|_____^| \____^| ^|_^| \___^| \__,_^| ^|_^| ^|_^| \___^| ^|_^|
echo.
echo [+] Start To Delete Regedit & echo.
reg delete HKEY_LOCAL_MACHINESYSTEMControlSet001ServicesEventlogApplicationMySQL /f
echo[ [*] DETELE HKEY_LOCAL_MACHINESYSTEMControlSet001ServicesEventlogApplicationMySQL
reg delete HKEY_LOCAL_MACHINESYSTEMControlSet002ServicesEventlogApplicationMySQL /f
echo[ [*] DETELE HKEY_LOCAL_MACHINESYSTEMControlSet002ServicesEventlogApplicationMySQL
reg delete HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesEventlogApplicationMySQL /f
echo[ [*] DETELE HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesEventlogApplicationMySQL
reg delete HKEY_LOCAL_MACHINESYSTEMControlSet001servicesMySQL /f
echo[ [*] DETELE HKEY_LOCAL_MACHINESYSTEMControlSet001servicesMySQL
reg delete HKEY_LOCAL_MACHINESYSTEMControlSet002servicesMySQL /f
echo[ [*] DETELE HKEY_LOCAL_MACHINESYSTEMControlSet002servicesMySQL
reg delete HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesMySQL /f
echo[ [*] DETELE HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesMySQL
echo.
echo [+] Start to Delete MySQL Service & echo.
net stop MySQL*
echo[ [*] STOP MYSQL SERVICE
sc delete MySQL*
echo[ [*] DELETE MYSQL SERVICE
echo.
echo [+] Start To Delete MySQL INI&Possible Install Files) Files
rd /s /q c:Program FilesMySQL
echo[ [*] DELETE C:Program FilesMySQL
rd /s /q c:Program Files (x86)MySQL
echo[ [*] DELETE C:Program Files (x86)MySQL
rd /s /q c:ProgramDataMySQL
echo[ [*] DELETE C:ProgramDataMySQL
rd /s /q c:Windowsmy.ini
echo[ [*] DELETE C:Windowsmy.ini
rd /s /q c:WindowsMySQL
echo[ [*] DELETE C:WindowsMySQL
rd /s /q c:WindowsSystem32TasksMySQL
echo[ [*] DELETE C:WindowsSystem32TasksMySQL
echo.
echo [+] Clean Process Over O(∩_∩)O~
echo.
echo [**] Please Restart the Computer ~
pause