I'm pretty sure you have 2 problems. The first problem is that you are doing an alphabetical comparison. Thus, "7" would be considered GTR "6000000000".
Your second problem is that numeric operations in cmd are limited to 32 bit integers. The maximum number you can use is 2^322^31 - 1, which is 21474836482147483647, which is already less than the number you are interested in.
The typical workaround here is to either compare the "important" parts of the string, or truncate the N least significant digits.
Here is a quick example. It may contain issues/errors in implementation. I did echo exit /b so the script would run and you can see the results instead of actual exit /b.
@echo off setlocal enabledelayedexpansion rem first we will inspect the 10th and 11th digits from the right set foldsize=7000000010 rem If there is any number in the 11th spot, then it must be greater if not "!foldsize:~0,-10!"=="" ( rem the number is at least 10000000000 which is greater so we exit echo exit /B 0 ) rem check if the 10th digit is 6 or greater rem add a zero to avoid issues with an undefined variable set smallfoldsize=!foldsize:~0,-9! if !smallfoldsize!0 GTR 50 ( rem technically the number is now greater or equal to 6000000000 rem I will leave it up to you if you really need it to be greater than echo exit /B 0 ) else ( rem it is smaller echo exit /B 1999 ) rem an alternative is to discard the N least significant digits rem I am stripping the last 7 digits and then adding a zero to avoid rem an undefined variable set smallfoldsize=!foldsize:~0,-7!0 if !smallfoldsize! GEQ 6000 ( echo exit /B 0 ) else ( echo exit /B 1999 ) rem again, this is actual greater or equal. If you rem need greater than, you have to look at the less rem significant digits when smallfoldsize = 6000