Linked Questions
21 questions linked to/from How to use random in BATCH script?
-3
votes
2
answers
826
views
I want to take a generate number between 1 to 5 in batch file [duplicate]
I want to generate a random number between 1 to 5 in a batch file
1
vote
1
answer
114
views
my arithmetic expression doesnt work in a CMD FOR loop [duplicate]
I want to generate a random number in a For Loop like that (part of it):
FOR /F "delims=, eol=; tokens=1,2" %%a in (DATA.TXT) DO (
SET min=10000
SET max=99999
SET /a passwort=!min!+(!...
0
votes
4
answers
16k
views
How do i get a random letter output in batch
How do i get a random letter output in batch that dose not need to update each time it just makes a new random letter soo something like this
@echo off
title random letter gen
echo ...
1
vote
3
answers
24k
views
How to generate a random number between 1 and 100 using batch
%random% seems to go in order.
@ECHO OFF
SET /A RAND=%RANDOM% %%100
ECHO %RAND%
ECHO.
If you keep running this it increments until it reaches 100 and then the number start over. If it were random it ...
1
vote
5
answers
6k
views
How to generate 4 digit random numbers in a batch file?
please give me the code for generating 4 digit random number in dos (batch) file
i tried
set /a num=%random% %%10000 +1
but this is not giving exactly 4 digit number every time. so please help me.
1
vote
3
answers
6k
views
Random line of text using batch
How could one select a random line of text from a text file and set it in a variable to use?
4
votes
5
answers
940
views
How can I multiply all values in a csv using Powershell or Batch?
I have a load of personal ID numbers, which I need to download automatically. Rather than store thousands of unique personal IDs on my machine, I want to multiply all the IDs by a random integer, save ...
1
vote
1
answer
4k
views
Batch file: random alphanumeric sequence
I'm a beginner in batch programming. I want to create a batch script in order to create a random sequence of eight alphanumeric characters. This is my tentative:
@echo off
setlocal ...
0
votes
2
answers
2k
views
Get a random sentence from a selection each time in Batch
Is there a way of making it so instead of saying the same echo that you set every time, you can give a list of echos and it chooses a random one to say each time it reaches that echo command?
-2
votes
6
answers
1k
views
Batch file to delete half the lines of a text file at random?
I need a way to use batch to look at every line of a text file, and delete half of the lines in that text file, choosing which lines to delete at random.
This is to simulate a tournament within a ...
0
votes
2
answers
482
views
Batch file - Pick a card
I created a batch file that selects a random playing card using the variable %random%. the batch script keeps looping until %random% is between 1 and 13, and does it again for the suit. I then ...
0
votes
1
answer
302
views
Even distribution of random numbers in Windows batch
I want a random number in Windows batch. Here's my command:
set /a "random_line=(%random%%%total)+1"
Is this going to give me an even distribution of random numbers?
EDIT:
I'd already looked at ...
0
votes
1
answer
703
views
Number Generator 1-4 | Batch
There is an easy way to make a number generator.
But I just want the generated numbers to be 1 - 4
The following program takes too long to get an output
@echo off
:RUN
set /a Num=%random%
if %...
1
vote
2
answers
500
views
How can I generate a four-digit random number?
I'm trying to make a batch file that creates a serial number in the format xxxx-xxxx-xxxx-xxxx-xxxx - that is, I want five randomly-generated four-digit numbers.
Unfortunately, %random% can return ...
0
votes
2
answers
453
views
How to make random number variable with variables within it?
So I've been trying to make the following code:
set /a num1=10
set /a num2=%random% %%60 +%num1%
echo %num2%
(This is simplified)
For this code I need the +%num1% to be a variable because I need to ...