首页 > 编程 > BAT > 正文

一个小助手批处理实例代码

2020-07-26 20:29:04
字体:
来源:转载
供稿:网友
包括
ECHO 1. 显示或隐藏文件
ECHO 2. 清理系统垃圾
ECHO 3. 注册表解除锁定
ECHO 4. 修复IE浏览器
ECHO 5. 关闭默认共享
ECHO 6. 管理控制MMC
ECHO 7. 清除多余启动项
@ECHO off
@title 小助手 By:柴子

:start
CLS
COLOR 0f
MODE con: COLS=41 LINES=18
set tm1=%time:~0,2%
set tm2=%time:~3,2%
set tm3=%time:~6,2%
ECHO %date% %tm1%点%tm2%分%tm3%秒
ECHO ────────────────────
ECHO 选择操作,回车! By: 柴子  QQ:3819843
ECHO ────────────────────
ECHO.
ECHO 1. 显示或隐藏文件
ECHO 2. 清理系统垃圾
ECHO 3. 注册表解除锁定
ECHO 4. 修复IE浏览器
ECHO 5. 关闭默认共享
ECHO 6. 管理控制MMC
ECHO 7. 清除多余启动项
ECHO 8. 注销
ECHO 9. 退出
ECHO.

:cho 
SET Choice=
SET /P Choice=请选择:
IF NOT "%Choice%"=="" SET Choice=%Choice:~0,1%
rem 如果输入大于1位,取第1位,比如输入132,则返回值为1
ECHO.
IF /I "%Choice%"=="1" GOTO xianshiyincang
IF /I "%Choice%"=="2" GOTO qinglilaji
IF /I "%Choice%"=="3" GOTO jiesuo
IF /I "%Choice%"=="4" GOTO xiufu
IF /I "%Choice%"=="5" GOTO gbgx
IF /I "%Choice%"=="6" GOTO mmc
IF /I "%Choice%"=="7" GOTO qidongxiang
IF /I "%Choice%"=="8" GOTO logoff
IF /I "%Choice%"=="9" GOTO end
ECHO 不是吧,选择1~9你也不会?再来!!!
pause
GOTO start

:xianshiyincang
echo  输入X显示 输入Y隐藏
set /p yszy=
if /i "%yszy%"=="""" (goto start)
if /i "%yszy%"=="x" (set xy=1  &set yszy=显示  &goto xywj1)
if /i "%yszy%"=="y" (set xy=0  &set yszy=隐藏  &goto xywj1)
goto xianshiyincang
:xywj1
REG ADD HKCU/Software/Microsoft/Windows/CurrentVersion/Explorer/Advanced/ /v Hidden /t REG_DWORD /d %xy% /F >nul
echo     ----------------------------------------------------------------------
echo 隐藏文件已 %yszy%.刷新即可
pause
GOTO start

:qinglilaji
@echo off
echo 正在清理系统垃圾文件,请稍等......
@del /f /s /q %systemdrive%/*.tmp
@del /f /s /q %systemdrive%/*._mp
@del /f /s /q %systemdrive%/*.log
@del /f /s /q %systemdrive%/*.gid
@del /f /s /q %systemdrive%/*.chk
@del /f /s /q %systemdrive%/*.old
@del /f /s /q %systemdrive%/recycled/*.*
@del /f /s /q %windir%/*.bak
@del /f /s /q %windir%/prefetch/*.*
@rd /s /q %windir%/temp & md %windir%/temp
@del /f /q %userprofile%/cookies/*.*
@del /f /q %userprofile%/recent/*.*
@del /f /s /q "%userprofile%/Local Settings/Temporary Internet Files/*.*"
@del /f /s /q "%userprofile%/Local Settings/Temp/*.*"
@del /f /s /q "%userprofile%/recent/*.*"
echo 清理系统垃圾完成!
pause
GOTO start

:jiesuo
@echo REGEDIT4>>123.reg
@echo.>>123.reg
@echo [HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Policies/System]>>123.reg
@echo "DisableRegistryTools"=dword:00000000>>123.reg
@REGEDIT /S /C 123.reg
@del "123.reg" /q /f
echo 成功解除注册表锁定!
pause
GOTO start

:xiufu
@echo off
echo 耗时较长,请等待...
rundll32.exe advpack.dll /DelNodeRunDLL32 %systemroot%/System32/dacui.dll
rundll32.exe advpack.dll /DelNodeRunDLL32 %systemroot%/Catroot/icatalog.mdb /s
regsvr32 setupwbv.dll /s
regsvr32 wininet.dll /s
regsvr32 comcat.dll /s
regsvr32 shdoc401.dll /s
regsvr32 shdoc401.dll /i  /s
regsvr32 asctrls.ocx /s
regsvr32 oleaut32.dll /s
regsvr32 shdocvw.dll /I  /s
regsvr32 shdocvw.dll /s
regsvr32 browseui.dll /s
regsvr32 browseui.dll /I  /s
regsvr32 msrating.dll /s
regsvr32 mlang.dll /s
regsvr32 hlink.dll /s
regsvr32 mshtml.dll /s
regsvr32 mshtmled.dll /s
regsvr32 urlmon.dll /s
regsvr32 plugin.ocx /s
regsvr32 sendmail.dll /s
regsvr32 comctl32.dll /i /s
regsvr32 inetcpl.cpl /i /s
regsvr32 mshtml.dll /i /s
regsvr32 scrobj.dll /s
regsvr32 mmefxe.ocx /s
regsvr32 corpol.dll /s
regsvr32 jscript.dll /s
regsvr32 msxml.dll /s
regsvr32 imgutil.dll /s
regsvr32 thumbvw.dll /s
regsvr32 cryptext.dll /s
regsvr32 rsabase.dll /s
regsvr32 triedit.dll /s
regsvr32 dhtmled.ocx /s
regsvr32 inseng.dll /s
regsvr32 iesetup.dll /i /s
regsvr32 hmmapi.dll /s
regsvr32 cryptdlg.dll /s
regsvr32 actxprxy.dll /s
regsvr32 dispex.dll /s
regsvr32 occache.dll /s
regsvr32 occache.dll /i /s
regsvr32 iepeers.dll /s
regsvr32 wininet.dll /i /s
regsvr32 urlmon.dll /i /s
regsvr32 digest.dll /i /s
regsvr32 cdfview.dll /s
regsvr32 webcheck.dll /s
regsvr32 mobsync.dll /s
regsvr32 pngfilt.dll /s
regsvr32 licmgr10.dll /s
regsvr32 icmfilter.dll /s
regsvr32 hhctrl.ocx /s
regsvr32 inetcfg.dll /s
regsvr32 trialoc.dll /s
regsvr32 tdc.ocx /s
regsvr32 MSR2C.DLL /s
regsvr32 msident.dll /s
regsvr32 msieftp.dll /s
regsvr32 xmsconf.ocx /s
regsvr32 ils.dll /s
regsvr32 msoeacct.dll  /s
regsvr32 wab32.dll /s
regsvr32 wabimp.dll /s
regsvr32 wabfind.dll /s
regsvr32 oemiglib.dll /s
regsvr32 directdb.dll /s
regsvr32 inetcomm.dll /s
regsvr32 msoe.dll /s
regsvr32 oeimport.dll  /s
regsvr32 msdxm.ocx /s
regsvr32 dxmasf.dll /s
regsvr32 laprxy.dll /s
regsvr32 l3codecx.ax /s
regsvr32 acelpdec.ax /s
regsvr32 mpg4ds32.ax /s
regsvr32 voxmsdec.ax /s
regsvr32 danim.dll /s
regsvr32 Daxctle.ocx /s
regsvr32 lmrt.dll /s
regsvr32 datime.dll /s
regsvr32 dxtrans.dll /s
regsvr32 dxtmsft.dll /s
regsvr32 vgx.dll /s
regsvr32 WEBPOST.DLL  /s
regsvr32 WPWIZDLL.DLL /s
regsvr32 POSTWPP.DLL /s
regsvr32 CRSWPP.DLL /s
regsvr32 FTPWPP.DLL /s
regsvr32 FPWPP.DLL /s
regsvr32 FLUPL.OCX /s
regsvr32 wshom.ocx /s
regsvr32 wshext.dll /s
regsvr32 vbscript.dll /s
regsvr32 scrrun.dll mstinit.exe /setup
regsvr32 msnsspc.dll /SspcCreateSspiReg
regsvr32 msapsspc.dll /SspcCreateSspiReg
echo.
echo 恭喜恭喜。IE修复结束...
pause
GOTO start

:gbgx
@echo off
net share c$ /delete 2>nul
net share d$ /delete 2>nul
net share e$ /delete 2>nul
net share f$ /delete 2>nul
net share g$ /delete 2>nul
net share h$ /delete 2>nul
net share g$ /delete 2>nul
net share admin$ /delete 2>nul
net share i$ /delete 2>nul
echo Windows Registry Editor Version 5.00> c:/delshare.reg
REG ADD HKLM/SYSTEM/CurrentControlSet/Control/LSA /v RestrictAnonymous /t REG_DWORD /d 1 /F >nul
REG ADD HKLM/SYSTEM/CurrentControlSet/Services/lanmanserver/parameters /v AutoShareWks /t REG_DWORD /d 0 /F >nul
REG ADD HKLM/SYSTEM/CurrentControlSet/Services/lanmanserver/parameters /v AutoShareServer /t REG_DWORD /d 0 /F >nul
echo 已经关闭所有默认共享.
echo.
pause
goto start

:mmc
start %windir%/system32/mmc.exe
GOTO start

:qidongxiang
@ ECHO OFF
@ ECHO ────────────────────
@ ECHO 自动清理所有非必要启动项,仅保留输入法。
@ ECHO 减少不必要资源占用,使系统运行顺畅。
@ ECHO ────────────────────
PAUSE
reg delete HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run /va /f
reg delete HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Run /va /f
reg add HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Run /v ctfmon.exe /d C:/WINDOWS/system32/ctfmon.exe
reg delete "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg" /f

reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/IMJPMIG8.1"
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/IMJPMIG8.1" /v command /d ""C:/WINDOWS/IME/imjp8_1/IMJPMIG.EXE" /Spoil /RemAdvDef /Migration32"
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/IMJPMIG8.1" /v hkey /d HKLM
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/IMJPMIG8.1" /v inimapping /d 0
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/IMJPMIG8.1" /v item /d IMJPMIG
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/IMJPMIG8.1" /v key /d SOFTWARE/Microsoft/Windows/CurrentVersion/Run

reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/PHIME2002A"
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/PHIME2002A" /v command /d "C:/WINDOWS/system32/IME/TINTLGNT/TINTSETP.EXE /IMEName"
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/PHIME2002A" /v hkey /d HKLM
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/PHIME2002A" /v inimapping /d 0
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/PHIME2002A" /v item /d TINTSETP
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/PHIME2002A" /v key /d SOFTWARE/Microsoft/Windows/CurrentVersion/Run

reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/PHIME2002ASync"
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/PHIME2002ASync" /v command /d ""C:/WINDOWS/IME/imjp8_1/IMJPMIG.EXE" /Spoil /RemAdvDef /Migration32"
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/PHIME2002ASync" /v hkey /d HKLM
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/PHIME2002ASync" /v inimapping /d 0
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/PHIME2002ASync" /v item /d TINTSETP
reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Shared Tools/MSConfig/startupreg/PHIME2002ASync" /v key /d SOFTWARE/Microsoft/Windows/CurrentVersion/Run

del "C:/Documents and Settings/All Users/「开始」菜单/程序/启动/*.*" /q /f
del "C:/Documents and Settings/Default User/「开始」菜单/程序/启动/*.*" /q /f
del "%userprofile%/「开始」菜单/程序/启动/*.*" /q /f
start C:/WINDOWS/pchealth/helpctr/binaries/msconfig.exe
goto start

:logoff
logoff

:end
exit
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表