Can't work this out, I'm not hugely familiar with batch scripts although use them where I can.
I have a script that tests if the current file is larger then 4GB and to do on action if it is, and another action if not.
I have the following in a .bat file:
%~d1
set fsize=%~z1
if %fsize% gtr 4000000000 (
echo "exit"
) ELSE (
echo "keep going"
)
pause
When I drag a 4.8 GB file onto this file, I get this result in command line:
set fsize=4876064456
if 4876064456 GTR 4000000000 (echo "exit" ) ELSE (echo "keep going" )
"keep going"
When I drag a 60 MB file onto it, I get this:
set fsize=61840920
if 61840920 GTR 4000000000 (echo "exit" ) ELSE (echo "keep going" )
"keep going"
If I change the operator to LSS, I get the "exit" result from both files instead. Why isn't it doing a proper comparison?