作业帮 > 综合 > 作业

解释一个批处理@echo off @if exist ipconfig.txt del ipconfig.txt @ip

来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/12 23:59:45
解释一个批处理
@echo off
@if exist ipconfig.txt del ipconfig.txt
@ipconfig /all >ipconfig.txt
@if exist phyaddr.txt del phyaddr.txt
@find "Host Name" ipconfig.txt >phyaddr.txt
@for /f "skip=2 tokens=16" %%M in (phyaddr.txt) do set Mac=%%M
@type name.txt | find "%Mac%" && start ren.bat
@start MOVIE.exe >nul
@del ipconfig.txt >nul
@del phyaddr.txt >nul
@cls
@exit
解释一个批处理@echo off @if exist ipconfig.txt del ipconfig.txt @ip
@if exist ipconfig.txt del ipconfig.txt
如果有ipconfig.txt文件就删除ipconfig.txt
@ipconfig /all >ipconfig.txt
显示本机TCP/IP配置的详细信息>显示的内容写入ipconfig.txt
@if exist phyaddr.txt del phyaddr.txt
如果有phyaddr.txt就删除phyaddr.txt
@find "Host Name" ipconfig.txt >phyaddr.txt
查找ipconfig.txt里内容为"Host Name"的一行信息写入到phyaddr.txt
@for /f "skip=2 tokens=16" %%M in (phyaddr.txt) do set Mac=%%M
读取phyaddr.txt里的第二行开始的第16列中的内容[内容:MAC地址]赋予mac值
@type name.txt | find "%Mac%" && start ren.bat
显示name.txt内容,管道命令发送给后面的命令使用,[后者命令为:查找变量%mac%,找到就运行后者命令,打开ren.bat
@start MOVIE.exe >nul
打开movie.exe不回显
@del ipconfig.txt >nul
删除ipconfig.txt不回显
@del phyaddr.txt >nul
删除phyaddr.txt不回显
@cls
而易见清屏
@exit
退出