|set op = 1|
I know this looks like good whitespace usage, and in other languages it often is, but in batch this sets a variable named "op "(including space) to the value of " 1"(including space). It doesn't ignore the spaces so you shouldn't add them unless you want them.
C:\Documents and Settings\Judago>set op = 1
C:\Documents and Settings\Judago>echo %op%
C:\Documents and Settings\Judago>echo %op %
C:\Documents and Settings\Judago>
But if I use %random% it will give 1 - 32776 (or some strange number) So I need to generate 1 - 36 or 1 - 62
set /a num=(%random% %% 36) + 1
To get at it you could use a variable as a list and the random number to take a single character. For this you will actually want 0-35 or 0-61 because the first character is at position 0.
Here is a quick example:
for /l %%a in (1 1 %length%) do (
set /a position=!random! %% total
for %%b in (!position!) do (
It's easy enough to just change the list/total/length values according to user input.