I am trying to create a simple password generator script to create passwords for a set of users.
The specs:
Users will be in this format username<number from 1 to 500>@domain
In other words, starting with username1@domain ending with username500@domain
These users should all have unique passwords, so we are applying some simple math to make it harder to figure out what the other passwords are (don't worry, I'm not working for a bank. I am just generating passwords for a internal service at a smaller company). What I want to do is to multiply the username number with a set of fixed values, for example (<user number> * 123 * 456 * 789).
This is the script I have where I have tried to multiply the user number with 5:
Code: Select all
echo off
set user=username
set domain=@domain
FOR /L %%G IN (1,1,500) DO (
set /a pwresult=%%G*5
echo %user%%%G%domain% %pwresult% >> passwords.txt
)
The script currently generates the following in password.txt
username1@domain 2500
username2@domain 2500
username3@domain 2500
username4@domain 2500
username5@domain 2500
username6@domain 2500
username7@domain 2500
username8@domain 2500
username9@domain 2500
[... to 500]
What I expected it to do is to multiply %%G with 5, creating this result:
username1@domain 5
username2@domain 10
username3@domain 15
username4@domain 20
username5@domain 25
username6@domain 30
username7@domain 35
username8@domain 40
username9@domain 45
What am I doing wrong?