I have a script that calculates disk space in bytes. I have found a way to convert it to megabytes. I have just run it and i got a this: 1867.603187561035
. Is there
Here is a native batch/jscript hybrid posted recently that will
return a MB
figure, for a byte
figure given as %1
(and not limited to 2GB figures as batch math is)
It does not round up or round down the partial megabyte after the decimal point, it just removes it.
@if (@CodeSection == @Batch) @then
@echo off
set JScall=Cscript //nologo //E:JScript "%~F0"
for /f "delims=." %%a in ('%JScall% "%~1/1024/1024"') do set "size=%%a"
echo %size%
goto :EOF
@end
WScript.Echo(eval(WScript.Arguments.Unnamed.Item(0)));