|I have no idea why "set /a" spits out an error, the sum *looks* valid.|
I had the logic mixed up with #5, try this instead.
set /a number=(%random% %% ((max - min) + 1 )) + min
As for the for loops there are a couple of types in batch "for /?" from the command line will show some basic help.