批處理打造MySQLCleaner
1. 簡(jiǎn)介
??????在我們卸載MySQL數(shù)據(jù)庫(kù)的時(shí)候裆馒,往往除了需要卸載軟件霜第,還需要?jiǎng)h除各種注冊(cè)表信息,隱藏文件,卸載服務(wù)僵闯,否則當(dāng)我們?cè)俅伟惭bMySQL時(shí)就會(huì)出現(xiàn)一些令人難以理解的錯(cuò)誤卧抗。所以為了簡(jiǎn)單起見(jiàn),本人用批處理簡(jiǎn)單寫(xiě)了一個(gè)清理軟件鳖粟,基本上是默認(rèn)安裝路徑的都可以一鍵清除社裆,如果有特殊情況,可參照百度經(jīng)驗(yàn)完全卸載mysql數(shù)據(jù)庫(kù)圖文教程向图,然后停止并刪除服務(wù)即可泳秀。
2. 注意事項(xiàng)
請(qǐng)以管理員權(quán)限運(yùn)行此程序!榄攀!
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_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL /f
echo[ [*] DETELE HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL
reg delete HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL /f
echo[ [*] DETELE HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL
reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MySQL /f
echo[ [*] DETELE HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MySQL
reg delete HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\MySQL /f
echo[ [*] DETELE HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\MySQL
reg delete HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\services\MySQL /f
echo[ [*] DETELE HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\services\MySQL
reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MySQL /f
echo[ [*] DETELE HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MySQL
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 Files\MySQL
echo[ [*] DELETE C:\Program Files\MySQL
rd /s /q c:\Program Files (x86)\MySQL
echo[ [*] DELETE C:\Program Files (x86)\MySQL
rd /s /q c:\ProgramData\MySQL
echo[ [*] DELETE C:\ProgramData\MySQL
rd /s /q c:\Windows\my.ini
echo[ [*] DELETE C:\Windows\my.ini
rd /s /q c:\Windows\MySQL
echo[ [*] DELETE C:\Windows\MySQL
rd /s /q c:\Windows\System32\Tasks\MySQL
echo[ [*] DELETE C:\Windows\System32\Tasks\MySQL
echo.
echo [+] Clean Process Over O(∩_∩)O~
echo.
echo [**] Please Restart the Computer ~
pause