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-20T08:12:40+00:00

    Thank you so much for your swift reply and helpful answer.

    I hope you do not mind to explain what are these stands for

    rd /s /q

    0 comments No comments
  2. Anonymous
    2020-10-20T08:36:03+00:00

    I hope you do not mind to explain what are these stands for

    rd /s /q 

    rd = Remove directory

    /s = Recursive delete

    /s = Silent mode, i.e. not asking for confirmation

    You could see all this by typing this command at the Command Prompt:

    rd  /?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2020-10-20T08:50:31+00:00

    Hi, I'm Elise, an independent advisor and I'd be happy to help with your issue.

    You would also need to delete the user folder, you can use a powershell command like:

    Remove-Item 'C:\User\Username' -Recurse

    Please let me know if you need any further assistance.

    Kind Regards,

    Elise

    0 comments No comments
  4. Anonymous
    2020-10-20T10:35:39+00:00

    Hi Elise,

    Thank you for your reply but your command is not working on PowerShell. Please help me

    Remove-Item 'C:\Users\averda' -Recurse

    Remove-Item 'C:\User\Username' -Recurse

    0 comments No comments