How to delete user account with its folder via CMD or Powershell

Anonymous
2020-10-20T07:03:04+00:00

I have windows 10 machines with several users on it.

I want to delete these user via CMD or Powershell with all their folders (desktop, download, ........etc)

The below command :

net user Test /delete

only delete the user which is not enough.

Windows for home | Windows 10 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2020-10-20T07:34:23+00:00

    The below command :

    net user Test /delete 

    only delete the user which is not enough.

    Easy:

    rd /s /q "C:\Users\UserName"

    Please remember to mark my reply by clicking "Did this solve your problem?".

    50 people found this answer helpful.
    0 comments No comments

9 additional answers

Sort by: Most helpful
  1. Anonymous
    2020-10-20T10:37:09+00:00

    It should be the top command, does it give any error message when you try to do this?

    Kind Regards,

    Elise

    0 comments No comments
  2. Anonymous
    2020-10-20T10:45:50+00:00

    yes it is giving me the attached screenshot error in my previous reply 

    I used the first command because you missed the S letter in user

    please try it on your computer first

    0 comments No comments
  3. Anonymous
    2020-10-20T10:48:43+00:00

    Ah ok sorry I didn’t see your screenshot, you will likely need to take ownership of the folder first:

    https://www.apeswithcomputers.com/article/take-...

    Kind Regards,

    Elise

    0 comments No comments
  4. Anonymous
    2020-10-20T11:30:07+00:00

    thank you Elise,

    I prefer Frederik Long command

    0 comments No comments