Linked Questions

-3 votes
2 answers
826 views

I want to generate a random number between 1 to 5 in a batch file
AKM The Gamer's user avatar
1 vote
1 answer
114 views

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!+(!...
user avatar
0 votes
4 answers
16k views

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 ...
eggsedan's user avatar
1 vote
3 answers
24k views

%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 ...
RBC's user avatar
  • 39
1 vote
5 answers
6k views

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.
Shivam Kumar's user avatar
1 vote
3 answers
6k views

How could one select a random line of text from a text file and set it in a variable to use?
LabRat's user avatar
  • 2,014
4 votes
5 answers
940 views

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 ...
Ne Mo's user avatar
  • 284
1 vote
1 answer
4k views

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 ...
user3482381's user avatar
0 votes
2 answers
2k views

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?
Dan Manwaring's user avatar
-2 votes
6 answers
1k views

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 ...
Meep the Changeling's user avatar
0 votes
2 answers
482 views

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 ...
user avatar
0 votes
1 answer
302 views

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 ...
grgoelyk's user avatar
  • 457
0 votes
1 answer
703 views

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 %...
Moonicorn's user avatar
1 vote
2 answers
500 views

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 ...
AdamTheCarpenter's user avatar
0 votes
2 answers
453 views

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 ...
Victor Chavez's user avatar

15 30 50 per page