≡ Menu

Delete user account from command line

We can use the below commands to delete a user account using windows command prompt.

To delete a user account of the local system:

net user username /DELETE

To delete a user account from domain:

net user username /DELETE /DOMAIN

You need to have domain administrator privileges to perform this operation. Note that we do not need to specify the domain name in this command.

The above commands work on Windows 7, Windows 8, XP and also on all Server editions.
Related Posts:
Add new user account
Get user names from command prompt

7 comments… add one
  • Edward Allington

    This command works for me with accounts without spaces in their names, but in accounts with spaces in their names, it says:
    The syntax of this command is:

    NET USER
    [username [password | *] [options]] [/DOMAIN]
    username {password | *} /ADD [options] [/DOMAIN]
    username [/DELETE] [/DOMAIN]
    username [/TIMES:{times | ALL}]

    Why doesn’t it work?

  • MIG Tech Sean

    @Edward Allington
    I would suggest you use quotes around the usernames with spaces. I.e. net user “Jack Smith” /delete /Domain

  • anton

    i have error
    “the connection was denied because the user account is not authorized for remote login”
    how do i enable remote desktop session after adding new user account?

  • jason

    I still cannot create password for the new user account that was created in cmd….I hate this!!!!

    • john

      What do you mean Jason????

  • Steve Martin

    not sure how old this post is but if you are able to respond.. I have an issue. I have a laptop that has been used in an onsite network and a mutual vpn. I have enabled the net user administrators account but I noticed that the drive that is shown is X: I went to C: to do all my work so far, so I am on C:\windows\system32. I want to do away with the profile X: since it is controlling the login. How can I remove the network profile as well as the VPN environment thru the command prompt? This is a upgraded windows 10 environment.. thanks

    • Don

      The X: drive is typically a virtual drive created in memory just for the purpose of temporary storage for that session. It is deleted and removed when you close the session.

Leave a Comment