• 批处理打造MySQLCleaner


    #批处理打造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
    
  • 相关阅读:
    2020软件工程作业02
    第一次作业
    伪造IP
    Windows 上安装metasploit
    Kali安装 Typora
    在linux系统中安装调用汉语打字软件
    2020 年 10 月 10 日跑步随想
    最长公共前缀
    N皇后
    一道有趣的异步题
  • 原文地址:https://www.cnblogs.com/csnd/p/12897041.html
Copyright © 2020-2023  润新知