📄 多功能批处理.bat
字号:
echo\
set /p wenben=
call :wenben
if "%old%"=="" goto txt2input
cd /d "%lj%"
set xwenben=!m!行号!x!
for /f "tokens=*" %%i in (%file%\多功能批处理tmp.txt) do (
set "ju=%%i"
set /a hanghao=!hanghao!+1
echo !hanghao!. !ju!>>!xwenben!)
echo\&echo\&echo 完成!按任意键返回……
pause>nul
goto 15
:txt3
set wenzi=
set gs=
set wenben=
echo\&echo\&echo\
:txt3input
echo 请输入要查找的文件路径或将文件拖入。
echo\
set /p wenben=
call :wenben
if "%old%"=="" goto txt3input
cd /d "%lj%"
:wenziinput
echo\
echo 请输入要查找到文字:
echo\
set/p wenzi=
if "%wenzi%"=="" goto :wenziinput
for /f "tokens=*" %%i in ('find "%wenzi%" %file%\多功能批处理tmp.txt') do (
set ju=%%i
set/a gs=!gs!+1)
msg * 查找到共有!gs!行包含%wenzi%
goto 15
:txt4
set hang=
set wenben=
set xwenben=
set ju=
echo\&echo\&echo\
:txt4input
echo 请输入要删除空行文件路径或将文件拖入。
echo\
set /p wenben=
call :wenben
if "%old%"=="" goto txt4input
cd /d "%lj%"
set xwenben=!m!去除空行!x!
for /f "tokens=*" %%i in (%file%\多功能批处理tmp.txt) do (
set ju=%%i
call :txt4pan
)
echo\&echo\&echo 完成!按任意键返回……
pause>nul
goto 15
:txt4pan
if "%ju%"=="" echo\>>!xwenben! & goto :eof
echo !ju!>>!xwenben!
goto :eof
:txt5
echo 请输入要删除空行文件路径或将文件拖入。
echo\
set /p wenben=
call :wenben
if "%old%"=="" goto tx5input
cd /d "%lj%"
set xwenben=!m!排列显示!x!
sort %file%\多功能批处理tmp.txt >!xwenben!
echo\&echo\&echo 完成!按任意键返回……
pause>nul
goto 15
:txt6
goto input
:wenben
set old=
for /f "tokens=*" %%i in ("%wenben%") do (
set "lj=%%~dpi"
set "old=%%~fi"
set "m=%%~ni"
set "x=%%~xi")
copy /y %wenben% "%file%\多功能批处理tmp.txt" >nul
goto :eof
:16
if exist %file%\qd.txt del %file%\qd.txt
set timeouta=
set btid=
set kj=
bootcfg|find "好记的名称" >%file%\tempaa.txt
set /p qd=<%file%\tempaa.txt
for /f "tokens=2 delims=:" %%i in ("!qd!") do (set defn=%%i)
for /f "tokens=2 delims=:" %%i in ('bootcfg^|find "timeout"') do set timeout=%%i
echo 您的默认启动的系统为:!defn!,默认等待时间为:%timeout%秒
echo\&echo\
echo 当前在您的电脑中已安装的系统ID和名称
echo\&echo\
for /f "tokens=2 delims=:" %%i in (%file%\tempaa.txt) do (
set /a btid=!btid!+1
set qd!btid!=%%i
echo ID !btid! :%%i
echo\
echo ID !btid! :%%i >>%file%\qd.txt
)
:kjxz
echo\&echo\
echo 请选择下次要默认启动系统的ID(或输入t则修改默认等待时间):
set/p= <nul
set/p kj=
echo\
echo\
if "%kj%"=="t" goto timexz
if "%kj%"=="T" goto timexz
for /l %%i in (1,1,%kj%) do set mrqd=!qd%%i!
bootcfg /default /id %kj% 2>nul >nul
if errorlevel 1 echo 不存在改ID,请重新输入!&goto kjxz
if errorlevel 0 echo 设置成功,下次将默认启动!mrqd!,等待时间为:%timeout%秒!
for /l %%i in (1,1,2000) do ver>nul
call :cl
goto input
::备选
:timexz
echo\
echo\
echo 请输入默认等待时间秒:
set /p kai=
echo\
BOOTCFG /TIMEOUT !kai! 2>nul>nul
if "%errorlevel%"=="1" echo 输入错误,请重新输入&goto timexz
if "%errorlevel%"=="0" echo 修改成功,下次启动默认等待时间为:%kai%秒!
for /l %%i in (1,1,1500) do ver>nul
cls
goto :16
:17
cls
echo\&echo\
echo 正在检测防火墙……
sc config sharedaccess start= auto >nul 2>nul
sc start sharedaccess >nul 2>nul
cls
set port=
set kaishi=
set jiewei=
echo\&echo\
echo 说明:屏蔽的端口范围为1到65535用"/"或"-" ","来指定范围,如2或10-20或10/20或2,3,4,5
for /l %%i in (1,1,5) do echo\
:17input
echo\&echo\
set/p=请输入端口号:<nul&set /p port=
if "%port%"=="" goto 17input
echo\&echo\
echo 请稍后……
netsh firewall set portopening ALL %port% 被屏蔽的%port%端口 DISABLE ALL >nul
if "%errorlevel%"=="1" echo 您可能输入了错误的端口&ping/n 3 127.1>nul&goto 17
echo\
echo 屏蔽成功,%port%端口将被防火墙阻止。
echo\&echo\
call :cl
goto input
:18
for /l %%i in (1,1,15) do echo\
call :select "Physical Address" "MAC"
call :select "IP Address" "ip"
arp -s %ip% %Mac% 2>nul >nul
IF "%ERRORLevel%"=="1" echo 绑定失败,请检查你的网卡是否被禁用,或IP是否已分配!&echo\&echo\&pause&goto input
ECHO IP:%ip% MAC:%MAC%.Arp绑定成功!
call :cl
goto input
:19
cls
wmic process get Caption,ProcessId >%systemdrive%\progra~1\XuanYuan\tempaa.txt
echo 进程 PID >%systemdrive%\progra~1\XuanYuan\tempa.txt
more /s +1 %systemdrive%\progra~1\XuanYuan\tempaa.txt>>%systemdrive%\progra~1\XuanYuan\tempa.txt
start %systemdrive%\progra~1\XuanYuan\tempa.txt
del /f %systemdrive%\progra~1\XuanYuan\tempaa.txt
echo\
:19input
set pid=
set/p pid=请输入进程对应的PID值(输入Q返回):
if /i "%pid%"=="Q" goto input
ntsd -c q -p %pid% >nul 2>nul
if not "%errorlevel%"=="0" echo\&echo 输入错误的PID,请重新输入&ping /n 2 127.1>nul&goto 19
echo 成功的结束了 PID号为%pid%的进程!
ping /n 2 127.1>nul
call :cl
goto input
:20
cls
set disk=
title 开始分析磁盘
echo\&echo\&echo 开始分析磁盘
wmic logicaldisk where drivetype=3 get caption>%systemdrive%\progra~1\XuanYuan\disk.txt
cls
echo\&echo\
echo 分区 总共 可用 零碎 建议
for /f "tokens=* skip=1" %%i in ('type %systemdrive%\progra~1\XuanYuan\disk.txt') do (
set disk=%%i
set disk=!disk: =!
title 正在分析!disk!磁盘分区
defrag !disk! -a>%systemdrive%\progra~1\XuanYuan\dkfx.txt
set zl=
for /f "tokens=1,2,3 delims=," %%i in ('find "总共" %systemdrive%\progra~1\XuanYuan\dkfx.txt') do (
set total=%%i
set total=!total:总共=!
set beuse=%%j
set beuse=!beuse:可用=!
set suip=%%k
)
for /f "tokens=*" %%i in ('find "进行碎片整理" %systemdrive%\progra~1\XuanYuan\dkfx.txt') do set zl=%%i
echo\
echo !disk!!total! !beuse! !suip! !zl!
)
title 磁盘碎片整理
echo\&echo\
:20input
set zldisk=
set/p zldisk=请输入需要整理碎片的分区(输入0返回主菜单):
if "%zldisk%"=="0" goto input
defrag !zldisk! -a >nul 2>nul
if not "%errorlevel%"=="0" echo 输入错误,请重新输入!&goto 20input
title 正在整理!zldisk!
echo\
echo 整理时间依碎片大小而定,您可以最小化当前窗口等待程序运行!
echo\
echo 请稍后,正在整理!zldisk!分区……
defrag !zldisk! -f >nul 2>nul
echo\&echo\
title 整理碎片成功!
echo 整理碎片成功!!按任意键返回
pause>nul
call :cl
goto input
:21
echo\&echo\
echo 当前版本更新时间:13:39 2008-04-24 星期四。请对照
ping /n 2 127.1>nul
start /max http://huajinghua.go3.icpcn.com
pause
goto input
:22
::为保护原创及各位网友的建议意见,以下代码未经本人允许请勿随意修改或删除!
echo\&echo\&echo\&echo\&echo\
set/p= <nul
for /l %%b in (0,1,32) do (
set ",=★多功能批处理----网络痴迷,QQ:59061798。欢迎使用!"
set/p=!,:~%%b,1!<nul
set/p= ★<nul
for /l %%l in (1,1,600) do ver>nul
set/p=<nul)
for /l %%l in (1,1,1500) do ver>nul
echo\&echo\&echo\
set/p= <nul
call :ycbh "感谢以下网友提供的建议、意见及BUG!"
echo 网友 QQ
echo\
call :ycbh "小程序员 724932946"
call :ycbh "旋涡鸣人 773772682"
call :ycbh "Heartbreak 112724623"
call :ycbh "儍苽-℡藸 183405627"
call :ycbh "地平线 84180619"
echo\
echo\&echo\&echo\&echo\&echo\
set/p= <nul
for /l %%i in (0,1,14) do (
set ",=获取本产品更多信息,请到 : "
set/p=!,:~%%i,1!<nul
for /l %%l in (1,1,600) do ver>nul
)
for /l %%a in (0,1,29) do (
set,=http://e0434.qyun.net
set/p=!,:~%%a,1!<nul
for /l %%a in (1,1,500) do ver>nul
)
for /l %%a in (1,1,5000) do ver>nul
for /l %%i in (0,1,2) do (
for /l %%a in (0,1,29) do set/p=<nul
for /l %%a in (1,1,2000) do ver>nul
for /l %%a in (0,1,29) do set/p= <nul
for /l %%a in (1,1,2000) do ver>nul
for /l %%a in (0,1,29) do set/p=<nul
set/p=www.e0437.51.com<nul
)
for /l %%i in (0,1,2) do (
for /l %%a in (0,1,29) do (
set/p=<nul
set/p= <nul
set/p=<nul
for /l %%i in (1,1,100) do ver>nul)
for /l %%i in (0,1,29) do (
set,=http://hi.baidu.com/huajinghua
call set/p=!,:~%%i,1!<nul
for /l %%a in (1,1,500) do ver>nul
))
for /l %%i in (0,1,2) do (
for /l %%a in (0,1,29) do set/p=<nul
for /l %%i in (0,1,29) do (
set/p= http://e0434.qyun.net<nul
for /l %%a in (1,1,600) do ver>nul
for /l %%a in (0,1,29) do set/p=<nul
)
for /l %%i in (0,1,30) do (
set/p=http://e0434.qyun.net <nul
for /l %%a in (1,1,600) do ver>nul
for /l %%a in (0,1,31) do set/p=<nul
)
set/p= http://e0434.qyun.net<nul
)
echo\&echo\&echo\&echo\&echo\
set/p= 按任意键返回主菜单<nul
pause >nul
goto input
:caidan
if "%caidandate%"=="" (exit) else set caidandate=%date% %time%
set/a xc=%random%%%4+1
set te=
for %%i in (a b e f) do (
set /a te=!!te!+1!
if "!xc!"=="!te!" set xc=%%i)
color 1%xc%
cls
echo %caidandate% 您的IP为:%caidanxianshiip%
echo\&echo\&echo 多功能批处理 MADE by 网络痴迷 QQ:59061798
echo\&echo ◎菜单◎ &echo\
echo ======================================================================
echo $ $
echo $ 1=查看本地连接详细信息 2=%caidan2% $
echo $ $
echo $ 3=发起QQ临时会话 4=每日定时清理系统垃圾 $
echo $ $
echo $ 5=清理磁盘 6=检查硬盘错误 $
echo $ $
echo $ 7=%caidan7% 8=网速测试 $
echo $ $
echo $ 9=查看电脑详细信息 10=常用系统优化 $
echo $ $
echo $ 11=显示局域网上的所有共享资源 12=锁定计算机 $
echo $ $
echo $ 13=查看系统进程及路径 14=%caidan14% $
echo $ $
echo $ 15=常见文本处理 16=更换开机默认系统 $
echo $ $
echo $ 17=屏蔽指定端口 18=ARP绑定 $
echo $ $
echo $ 19=强行结束进程 20=碎片整理 $
echo $ $
echo $ 21=查看最新版本 22=产品动画广告 $
echo $ $
echo ======================================================================
echo\
echo (注释:等号左边的为功能代号,请输入左边的的代号!)
echo\
goto :eof
:cl
for /l %%i in (1,1,40) do (
echo\
for /l %%a in (1,1,250) do ver>nul
)
goto :eof
:zb
if not "%CMDEXTVERSION%"=="2" msg * 抱歉!当前只支持XP SP2系统。&pause&exit
set caidandate=
set caidandate=%date% %time%
if exist %windir%\everybat.bat del /f /q %windir%\everybat.bat >nul
copy "%~f0" %windir%\everybat.bat >nul
if not exist "%file%\dg.bat" copy "%~f0" "%file%\dg.bat"
del /f /q %systemdrive%\progra~1\XuanYuan\*.txt >nul 2>nul
:wbtyzb
if not exist %systemdrive%\progra~1\XuanYuan md %systemdrive%\progra~1\XuanYuan>nul
set file=%systemdrive%\progra~1\XuanYuan
call :select "Dhcp Enabled" "dhcp"
call :select "ip" caidanxianshiip
SC config Schedule start= auto>nul 2>nul
if "%dhcp%"==" Yes" (set "caidan2=固定IP地址") else (set "caidan2=获取动态IP")
at|find "shutdown" >nul
if errorlevel 1 (set caidan7=开启自动关机) else (set caidan7=删除自动关机)
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoAdminLogon" 2>nul>nul
if "%errorlevel%"=="1" set caidan14=设置用户自动登录XP
if "%errorlevel%"=="0" set caidan14=删除用户自动登陆XP
goto :eof
★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
-----网络痴迷。
http://e0437.51.com || http://e0437.qyun.net
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -