- Joined
- Jun 9, 2005
- Messages
- 2
- Reaction score
- 0
I am trying to grab a random number within a specific range for a batch job I've been toying with. I don't know too much about using cmd.exe as a command shell in Windows 2000 Pro, so I'm probably missing an obvious and easy solution. So far the best structure I could come up with would be something like:
SET rnd=
FOR /L %variable IN (range) DO IF %RANDOM%==%variable SET rnd=%variable
which is obviously wrong. I could use help with the syntax but even moreso with the logic. Also, third-party tools are out o' the question; cmd.exe commands only. Thanks for any feedback.
SET rnd=
FOR /L %variable IN (range) DO IF %RANDOM%==%variable SET rnd=%variable
which is obviously wrong. I could use help with the syntax but even moreso with the logic. Also, third-party tools are out o' the question; cmd.exe commands only. Thanks for any feedback.