头痛的浮点计算,还是调用vbs吧:- @echo off
- if "%1" neq "" goto next
- for %%a in (ForBruteIp.txt) do set "k=%%~za"
- mshta vbscript:createobject("wscript.shell").run("%~fs0 "^&round(%k%/1024,4)^&" "^&round(%k%/1024/1024,4))(window.close)
- goto :eof
- :next
- setlocal enabledelayedexpansion
- set "k1=%1"&set "k2=%2"
- for %%a in (k1 k2) do if "!%%a:~,1!" equ "." set %%a=0!%%a!
- echo 文件大小为%k1%kb %k2%M
- pause>nul
复制代码
|