On a Windows 2000 or later system, you can use the
net use
command to change the password for any account from the command line,
if you are logged into an account that is a member of the Administrators
group on the system.
If you issuse the command net use username *
,
you will be prompted for a password and then asked to confirm the password.
The password will not be echoed.
C:\Documents and Settings\administrator>net user jsmith *
Type a password for the user:
Retype the password to confirm:
The command completed successfully.
Alternatively, you can specify the new password following the account name on the command line. You will not be asked to confirm the password in that case. This method allows you to change the password for an account with a script.
C:\Documents and Settings\administrator>net user jsmith MyPaSs999
The command completed successfully.
If you attempt to use the command to change the password for another account when you are not logged in as a member of the administrator's group, you will receive a "System error 5 has occurred. Access is denied" error message.
References: