I'm sure you already that getting a string length from input is not very straight forward in batch file script. An easy approach is to test whether the first 5 characters (or any x number of characters) of the input string is the same as the input string. For example:
SET /P INPUT=Enter your string:
IF [%INPUT%]==[%INPUT:~0,5%] (
ECHO %INPUT% has more than 5 chars
) ELSE (
ECHO %INPUT% has less than 5 chars
)
Admittedly, this will not work for every logic scenario you might need, but its fairly straight forward for a number scenarios. FYI, I added the []
characters to prevent empty string comparisons.
Hope that helps...