回复 6# adrien0901
临时给你改一个吧,只有整数位,没有小数,重定向到1.txt- @echo off&setlocal EnableDelayedExpansion
- >%temp%\tmp.vbs echo Wscript.Echo round(wscript.arguments(0)/wscript.arguments(1),2)
- for /f "tokens=1,2,3 delims= " %%a in ('wmic logicaldisk where "drivetype=3" get deviceid^,size^,freespace^|find ":"') do (
- call :calculate %%c 1073741824 allGB
- echo.%%a空间:!allGB!GB
- set /a all+=allgb
- )
- echo.&echo 硬盘总空间约为:%all%GB
- echo.&echo 硬盘总空间约为:%all%GB>1.txt
- del %temp%\tmp.vbs&pause>nul&exit
- :calculate
- for /f "delims=" %%i in ('cscript //nologo %temp%\tmp.vbs %1 %2') do (set %3=%%i)
- goto :eof
复制代码
|