Manage XP and Vista users using DOS commands

December 2016

Managing users of Windows on cmd prompt is not easy. The below illustrated expressions for Vista and XP users explain assimilation of certain steps for managing DOS users. It is important to know how to activate and deactivate users, and to help every user login with specific passwords. This will maintain the login and logout session of every user in DOS from a particular OS. Windows users can request a change of password if privileges are granted in DOS. An administrator of any company has to configure settings including the minimum length of password, reuse of passwords and changing passwords in a particular session. These settings are done to filter cmd users in the workplace.



Here is how to manage users with DOS in XP and Vista. You might say, why go through DOS if you can go through gpedit.msc?

The simple answer is that there is no gpedit.msc in Vista, whereas DOS commands work for all versions.

Before you begin, you need to know where to enter commands. First, log on as administrator.
For XP: Start Menu-> Run ... -> Type cmd and press enter

For Vista: Start Menu-> in the search module type cmd-> right click cmd and run as administrator.


Enabling or disabling a user


What does this mean?

This enables a user to logon or not. If a user is active, it can connect, if it is inactive, it will not connect.

To disable the user in the DOS window, type:

net user user_name /active:no


or, to enable, type:

net user user_name /active:yes

Set a password

  • What does this do?


This command defines a new password for a user.
  • How do I do it?


You need to type:

net user user_name password

Requiring a user to change password at next logon

  • What does this do?
    • This defines whether a user must change their password when they next logon.
  • How do I do it?
    • to make the user change their password at next logon, type:
    • net user user_name /logonpasswordchg:yes

Specify if the user has the right to change their password

  • What does this mean?


This defines whether a user can change their password or not.
  • How do I do it?
    • to allow this feature, type:
    • net user user_name /passwordchg:yes
    • to disable it, type:
    • net user user_name /passwordchg:no

Set the minimum length of a password for all users

  • What is this?
    • This defines the minimum size of a password.
  • How do I do it?
    • Type:
      • net accounts /minpwlen: length

Choose the minimum period before a user can change their password

  • What does this do?


This selects the number of days before a user can change a password.
  • How do I do it?
    • Type:
      • net accounts / minpwage: Days

Prevent a user from reusing the same password

  • What does this do?


This prevents a user from reusing the same password. They can reuse the same password a certain number of times before having to change it, according to what you decide
  • How do I do it?
    • Type:
    • net accounts / uniquepw: Number range1 and 24

Related :

This document entitled « Manage XP and Vista users using DOS commands » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.