Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: User Account - Create

14 Sep 2014   #10
MAYK

Windows 7 Enterprise x64
 
 

Thanks a lot Jamie
and how can they have password?


My System SpecsSystem Spec
.
15 Sep 2014   #11
JDobbsy1987

Windows 8.1 Pro x64
 
 

Quote   Quote: Originally Posted by MAYK View Post
Thanks a lot Jamie
and how can they have password?
It actually creates a password with the /random option however as it is run in a batch file you don't see that output but we can create the password differently so i have removed the /random from the below code however it depends what you want their password to be, all the same password or different?

Here are a few options:
  1. Manually set the password after they are created.
  2. Create them all with the same password (see red text)
    Code:
    for /f %%n in (%userprofile%\desktop\users.txt) do (net user %%n password_here /add /expires:never)


3rd Option - Create them with different passwords based on a variable
This is a little different and requires 2 batch files due to the way variables work in a for loop but this is just as easy to run.

Create 2 batch files with the below codes and place them on your desktop:

Call this accounts.bat
Code:
for /f %%n in (%userprofile%\desktop\users.txt) do (set usr=%%n & call account2.bat)
Call this accounts2.bat
Code:
set rand=%random:~0,3%
set usr1=%usr%

net user %usr1% Password.%rand% /add /expires:never & echo %usr1% Password.%rand%>> %userprofile%\desktop\output.txt

Now, same as before...
  1. Put the text file users.txt with the list of names on the desktop.
  2. Run accounts.bat and it will create the accounts.

You will now see another text file on your desktop called output.txt, this is a list of the users created and the password assigned to it.

Essentially, it will generate a password called "Password.random_3_digits"

Example:
Code:
testuser1 Password.521
testuser2 Password.123
testuser3 Password.452
etc...
Regards,
Jamie
My System SpecsSystem Spec
18 Sep 2014   #12
MAYK

Windows 7 Enterprise x64
 
 

it is not working!
i did the steps and this is the output.txt after several times running accounts.bat & accounts2.bat:
Password.244
Password.245
Password.248
Password.248
Password.248
every time i run these two one line attach to output.txt & one account create.
the account's names are:
Password.244
Password.245
Password.248
Password.248
Password.248
Thanks
My System SpecsSystem Spec
18 Sep 2014   #13
JDobbsy1987

Windows 8.1 Pro x64
 
 

You should only run accounts.bat not accounts2.bat
accounts2.bat is automatically used by accounts.bat when needed.

Couple of things...
  • Make sure you have users.txt on your desktop with a list of names you need to create (1 name per line do a test with 2 accounts... say test1 and test2)
  • Make sure you run accounts.bat as administrator (right click accounts.bat and select run as administrator)

What output do you get then?

Regards,
Jamie
My System SpecsSystem Spec
.

18 Sep 2014   #14
MAYK

Windows 7 Enterprise x64
 
 

nothing happen,
no new account & no output.txt
My System SpecsSystem Spec
18 Sep 2014   #15
JDobbsy1987

Windows 8.1 Pro x64
 
 

Quote   Quote: Originally Posted by MAYK View Post
nothing happen,
no new account & no output.txt
Sorry to hear this isn't working for you, unfortunately i can't offer any more help on it as i'm not sure what the issue it as that works for me on my Windows 7 and Windows 8 computers.

Regards,
Jamie
My System SpecsSystem Spec
Comment

 User Account - Create




Tutorial Tools Search this Tutorial
Search this Tutorial:

Advanced Search




Similar help and support threads
Windows 7 Tutorial Category
Can't Create a New User Account Because I'm Using Symbols When I'm Not
The problem I'm having with creating an account is stupid and needs to be fixed. When I am making a new User Account, It asks for the name. So I type in a name for my account and click next or whatever. But it wont let me move on because it says I'm supposily using characters like (...
General Discussion
Cant create new user account!!!
I can't turn on guest account or even the built in admin account i tried making new accounts but still won't work. when ever i try to lo in it says " the user service service failed to log in profile cannot be loaded" . i am usiny my own profile which is administrator it's the only profile i have...
General Discussion
Any way to create a user account who can install only for itself?
Windows doesn't provide this ability, but perhaps there's another way? Let me explain the situation: I'm currently configuring a new PC with Windows 7 Home Premium for my father, to replace his old XP one. He is a simple user, using a limited selection of software and never installing...
General Discussion
cannot create a new admin user account
when i use my admin account to create a new admin account i get stumped. i can create the account, set the password, and then when i try to switch users, i click on the new account admin2, and i get a warning that "unknown user or bad password" i have actually seen posts in other...
General Discussion
I can't create a new user account
Hi, I'm not a new user but....I am unable to create a new user account. I've tried the cmd run as administrator, i've tried starting is safe mode. It says I'm the administrator but I don't have administrator rights, the error message i get when trying to create a new user account is "The...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:19.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App