I have seen all over the net limitations with the FOR command in DOS and passing more than 26 - 31 tokens and the work around. Here is one.

I have come up with my own method for doing this and as of yet have not seen anything resembling it, so I will post it. Instead of using a single string I counted all tokens within an entire file, but the same method could be used on a single line or string.

Text File

Code:

Hello world this is the first string
Hello world this is the second string
Hello world this is the third string
World this is not enough strings
Counting how many tokens are in this file
Oh look we can go above 26 28 32 with very little code
I am amused at how simple this is
Wow lets keep counting tokens
Gosh if we did this with a string and not an entire file imagine the posibilities
How many tokens have we counted so far...
86

:NEXT
for /f "tokens=1,*" %%a in ("%str%") do (
echo.[%%a] is the %token% token
set str=%%b
)
set /a token=%token%+1
if "%str%"=="" goto :eof
goto :NEXT

Notes

This was done with less than 20 lines of code minus all blank spaces and putting the FOR command on single lines shortens it up to 11 lines total. This method will count an infinite amount of tokens.
THE END =P