1.

Solve : .bat file to change multiple windows user's passwords?

Answer»

I have a .bat file that can change the password of one windows user account, however for the purpose i need it to be able to change the password of multiple or all user accounts. Here is the current .bat text so please tell me how to change it or write a new one.

@echo off

cls
set /p CP=Would you like to change the password of ANY user account on your pc? (Y/N):
IF '%CP%' == 'Y' GOTO CP
IF '%CP%' == 'y' GOTO CP
IF '%CP%' == 'N' GOTO DCP
IF '%CP%' == 'n' GOTO DCP

:CP
cls
set /p UN=What User Account Do you want to change the password for? (Type a user Name. For a list of users type UL.):
IF '%UN%' == 'UL' Goto NETUSER

cls
set /p AYS=Are You Sure you Want to Change the password of the account %UN%. (Y/N)
IF '%AYS%' == 'Y' goto CPY
IF '%AYS%' == 'y' goto CPY
IF '%AYS%' == 'N' Goto DCP
IF '%AYS%' == 'n' Goto DCP

:CPY
cls
Net User %UN% *
pause
exit

:DCP
cls
Echo The password will not be changed.
pause
exit

:NETUSER
Net User
pause
Goto :CPWhat you are doing would seem to be a violation of basic rules about privacy and security. If you are the real administrator of the system, you should already know this. So unless you can explain why you need to do this, it is doubtful any professionals would help you.I am in a club at school called cyberpatriots. In the club we are given virtual images that are messed up and need to be fixed. Every single time we need to do things like change the passwords and turn on the firewall. I want a batch file to do all the simple stuff quickly, so we can have more time to work on the more complicated problems with the image.I feel it necessary to "defend" what is being done here in a way. It is being replied to as if it defies security, or is some sort of exploit. It is not. NET USER * allows a password to be changed. It doesn't just allow you to change any password willy-nilly- one must have appropriate privileges. On a school network, for example, the user doing so will require domain administrator privileges. Given the context they have provided, it makes sense that they would have these privileges within the virtual images.

By the time this command is of any use for defeating security, that security is already defeated- as Raymond Chen would say, "You're already on the other side of the airtight hatchway".

All that said- I have no idea what the OP is asking for. If you want to deal with multiple accounts, just run the batch file multiple times. (perhaps in a SECOND batch file)Quote

I am in a club at school called cyberpatriots. In the club we are given virtual images that are messed up and need to be fixed

Anyone know if Microsoft has an exception for edu's to be able to copy and distribute images to students to operate under the same LICENSE key by which the image was created/activated?

Back in 2004 when I was in college we were strictly told to NOT violate Microsoft EULA by running any systems under the same license key as for the college didnt want the "Microsoft Police" there as the PROFESSOR stated. We also worked with virtual images of systems that the teacher would mess up, but they would be messed up by the teacher accessing your virtual PC 2004 image at your work station and then you had to go in and fix it. Sometimes it was a CD that was passed around the room that the teacher stated for everyone to run a program in the virtual environment that he made and burned to CD which would flip registry key entry VALUES that you wouldnt know what was changed until boot or until you went to perform some operation within the system etc. And you had to go in and fix the problems. Other times he didnt mess with anything, but wanted you to mess with it and then show him that you did it etc.Quote from: BC_Programmer on May 24, 2015, 05:00:43 PM
I feel it necessary to "defend" what is being done here in a way. It is being replied to as if it defies security, or is some sort of exploit. It is not. NET USER <username> * allows a password to be changed. It doesn't just allow you to change any password willy-nilly- one must have appropriate privileges. On a school network, for example, the user doing so will require domain administrator privileges. Given the context they have provided, it makes sense that they would have these privileges within the virtual images.

By the time this command is of any use for defeating security, that security is already defeated- as Raymond Chen would say, "You're already on the other side of the airtight hatchway".

All that said- I have no idea what the OP is asking for. If you want to deal with multiple accounts, just run the batch file multiple times. (perhaps in a second batch file)



The thing is i need the passwords changed as fast a possible. To run the batch file multiple times wouldn't be much faster than just going in and changing it the normal way. On the image we are given there are usually 5+ user accounts and each account needs the password to be changed to "Cyberpatriots!" or something like that. To be able to run the batch file once and change all the account passwords, to a specified password, is the thing i want. We are given admin privileges on the images we work on.It deems the BAT file you gave is harder Utahn it needs to be.
Here is what MS says about NET USER.

https://support.microsoft.com/en-us/kb/251394

Or, at the command line type:

Code: [Select]net help user
.. .and see all the options.
Quote from: FluffyWhale on May 25, 2015, 08:34:22 AM
The thing is i need the passwords changed as fast a possible. To run the batch file multiple times wouldn't be much faster than just going in and changing it the normal way. On the image we are given there are usually 5+ user accounts and each account needs the password to be changed to "Cyberpatriots!" or something like that. To be able to run the batch file once and change all the account passwords, to a specified password, is the thing i want. We are given admin privileges on the images we work on.
Instead of using set /p tp accept input, you can likely pipe keyboard input directly into the command eg.

Code: [Select]Net user BC_Programming * < newpassword



Discussion

No Comment Found