i need to get amount of disk free space in MB and compare if it is less than 40 MB,
The comparison leading to wrong result
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
for /f "tokens=3 delims= " %%A in ('dir /-c D:^|find "Dir(s)"') do (
set freeval=%%A
call iskcheck !freeval!
)
endlocal
goto :eof
iskcheck
set space=%1
REM 1 MB=1048575 Bytes, 40 MB=4195040 Bytes
set limit=4195040
set /a sub=%space%-%limit%
echo %sub%
echo %1 bytes
echo %space% bytes
echo %limit% bytes
echo Drive is D: and its freespace is %space% Bytes
if %space% GTR %limit% (echo disc space is high) else (echo Disc space is low.Cannot install the new software version.)
goto :eof
i need to get amount of disk free space in MB and compare if it is less than 40 MB,
The comparison leading to wrong result
Comparison chart you will need.
------------------------------"To better understand why you need a personal computer, let's take a look at the pathetic mess you call your life."
Reply to badge