用批处理得到每个目录占用的空间
实现代码如下:@echo off for /f "tokens=*" %%b in ('dir') do echo "%%b"|find "个文件">nul&&for /f "tokens=3*" %%c in ("%%b") do echo 当前目录 %%c %%d for
实现代码如下:@echo off for /f "tokens=*" %%b in ('dir') do echo "%%b"|find "个文件">nul&&for /f "tokens=3*" %%c in ("%%b") do echo 当前目录 %%c %%d for
显示自己的IP.bat实现代码如下:@echo off for /f "tokens=15" %%i in ('ipconfig ^| find /i "ip address"') do set ip=%%i echo %ip% pause
sz.reg转换成reg.bat.bat实现代码如下:@echo offfor /f "tokens=*" %%a in (type sz.reg) do echo echo %%a^>^>tmp.reg>>reg.batecho echo regedit /s tmp.re
@echo off if exist ipconfig.txt del ipconfig.txt ipconfig /all >ipconfig.txt if exist phyaddr.txt del phyaddr.txt find "Physical Address" ipconfig.
枚举显示.bat实现代码如下:@echo off mode con:cols=80 lines=8 title 枚举显示 set tgt=%windir% for /F "tokens=*" %%i in ('dir %tgt% /A- /B /S') do @(cls && ech
删除大小和类型一样的文件.bat实现代码如下:@ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION for /f "tokens=*" %%a in ('dir/a-d/b/oe') do set/a c+=1&set a!c!=%%a&set b!c!