%RANDOM%
gives you a random number between 0 and 32767.
Using an expression like SET /A test=%RANDOM% * 100 / 32768 + 1
, you can change the range to anything you like (here the range is [1…100] instead of [0…32767]).
More Related Contents:
- Capture output command CMD
- Batch file v PowerShell script
- How can I auto-elevate my batch file, so that it requests from UAC administrator rights if required?
- Batch file: Find if substring is in string (not in a file)
- Iterate all files in a directory using a ‘for’ loop
- How do I get the result of a command in a variable in windows?
- Trouble with renaming folders and sub folders using Batch
- Batch character escaping
- How to wait all batch files to finish before exiting?
- Format date and time in a Windows batch script
- Using a custom Tee command for .bat file
- Hidden features of Windows batch files
- How to get list of arguments?
- Create list or arrays in Windows Batch
- Using another language (code page) in a batch file made for others
- How can I debug a .BAT script?
- String processing in windows batch files: How to pad value with leading zeros?
- Start multiple tasks in parallel and wait for them in windows?
- CALL command vs. START with /WAIT option
- Dealing with quotes in Windows batch scripts
- “invalid path 0 files copied” Error while using xcopy command
- how to get yesterday’s date in a batch file
- Can I send some text to the STDIN of an active process under Windows?
- While loop in batch
- Windows shell command to get the full path to the current directory?
- Batch program to to check if process exists
- Foolproof way to check for nonzero (error) return code in windows batch file
- Windows batch script to delete everything in a folder except one
- ERRORLEVEL vs %ERRORLEVEL% vs exclamation mark ERRORLEVEL exclamation mark
- Create a list or an array and print each item in Windows Batch