The net user command in Windows Command Prompt deletes a local user account in a single line: net user /delete. The command removes the account from the local Security Account Manager database, which also removes the account's local profile association and its membership in local groups. Several qualifications matter: net user manages only local accounts, so it cannot delete a Microsoft-account-linked profile or a domain account; deleting an account does not automatically delete that user's files on disk; and the command requires an elevated Command Prompt because account deletion is an administrative operation protected by Windows access control.

What the Command Actually Does

net user is a built-in Windows utility that talks to the local Security Accounts Manager (SAM), the database that stores local account names, password hashes, group memberships, and account flags. When you run:

Windows looks up the local account named jsmith in the SAM, verifies that the caller has administrative rights, and then removes the account entry. The user can no longer sign in, the account disappears from the sign-in screen and from Local Users and Groups, and any local group memberships (Administrators, Users, Remote Desktop Users, and so on) are removed along with it.

A few operational details are worth knowing:

The username is positional. net user takes the account name as its first argument. If you omit it, the command lists accounts or displays details for the current user instead of deleting anything, so a typo in the name position changes the command's meaning entirely. Use /delete exactly. The switch is not case-sensitive, but it must be present. Running net user jsmith with no switch displays account information and deletes nothing. The account must be local. net user operates on the local SAM. If the machine is joined to an Active Directory domain and the name you supply resolves to a domain account, the command will report that the user name could not be found rather than reaching into the domain. Domain accounts are deleted with directory tools such as Remove-ADUser in PowerShell or Active Directory Users and Computers, not with net user. Microsoft accounts behave differently. On Windows 10 and 11, a user who signs in with a Microsoft account still has a local profile, but the identity is tied to the Microsoft account. net user may show the account, yet deleting it through the command line is not the supported path; the Settings app or Remove-LocalUser in PowerShell is the appropriate tool, and the Microsoft account itself is managed online. The command is silent on success. A successful deletion typically prints "The command completed successfully." There is no confirmation prompt and no recycle bin. That is why the next section matters.

Permissions: Why an Ordinary Command Prompt Fails

Account deletion is an administrative function. If you open Command Prompt normally and run net user someone /delete, Windows returns "System error 5 has occurred. Access is denied." The command itself is working correctly; the caller simply lacks the privilege.

The fix is to run Command Prompt elevated: right-click Command Prompt (or Terminal) and choose Run as administrator, or search for cmd, right-click the result, and select the same option. If User Account Control prompts, approve it. The elevated window is marked "Administrator:" in the title bar. Only from that window will net user /delete succeed against another account.

There are two corollaries. First, you cannot delete the account you are currently signed in with; Windows refuses with an error because the account is in use. Sign in with a different administrative account, or perform the deletion from another session. Second, on a domain-joined computer, a local administrator can delete local accounts but not domain accounts, and a domain administrator's rights do not automatically flow into the local net user command unless that administrator is also a member of the local Administrators group.

What Deletion Does Not Do

This is the most common source of confusion, and it deserves emphasis: deleting a user account does not delete the user's data. Windows removes the account from the SAM and removes the profile's registration, but the folder under C:\Users<name> typically remains on disk. Files, downloads, and application data stay where they were, accessible to administrators and potentially to future accounts that inherit the folder.

If the goal is to remove a person's data as well as their access, deleting the account is only the first step. You would also remove or archive the profile folder, and you should check for data stored outside the profile: shared folders, email archives, cloud sync folders, and application databases. Conversely, if the goal is merely to revoke access temporarily, consider disabling the account instead (net user /active:no), which preserves the profile and can be reversed. Deletion is effectively permanent from the SAM's perspective; recreating an account with the same name produces a new security identifier (SID), and the old profile is not automatically reattached.

A related distinction: deleting an account also does not remove the user from mail distribution lists, cloud services, or third-party applications where the identity may be registered. Those are separate systems with separate administrative interfaces.

Step-by-Step: Deleting a Local Account Safely

The order of operations matters more than the single command. A careful procedure looks like this:

1: Sign in with an administrative account other than the one being deleted. If the target account is the only administrator, create or enable another administrator first. You can promote an existing account with net localgroup administrators /add from an elevated prompt. 2: Back up anything you need. Copy the user's profile folder (C:\Users<name>) and any shared or synced data to a safe location if there is any chance it will be needed. 3: Check what the account is used for. Query group membership with net user and review whether the account runs scheduled tasks, services, or shared-folder permissions. A service running under a deleted account's credentials will fail after deletion. 4: Open an elevated Command Prompt. 5: Delete the account: net user /delete. Confirm that the output says the command completed successfully. 6: Verify: run net user to list remaining accounts, and check Local Users and Groups (lusrmgr.msc) or Settings > Accounts > Other users to confirm the account is gone. 7: Decide about the profile folder. If the data should go too, delete C:\Users<name> from an elevated session, keeping in mind that Windows may hold locks on some files until a reboot.

To find the exact account name before deleting, list accounts with net user or check wmic useraccount get name,sid (on systems where WMIC is available). Names with spaces require quotation marks: net user "John Smith" /delete.

The PowerShell Alternative and When It Is Better

Modern Windows ships PowerShell, and its account cmdlets are more explicit and script-friendly. The closest equivalent is:

Remove-LocalUser targets local accounts only, mirrors the net user behavior in that respect, and requires an elevated session. It has practical advantages: it validates the name, reports errors more legibly, and integrates with PowerShell scripting and logging. Related cmdlets include Get-LocalUser to list accounts, Disable-LocalUser to suspend one without deleting it, and New-LocalUser to create accounts. For a one-off deletion, net user and Remove-LocalUser are functionally interchangeable; for automation, the PowerShell cmdlet is generally the better choice because its error handling is more predictable.

Neither tool deletes the profile folder, and neither removes domain accounts or Microsoft accounts. Those limits are properties of local account management, not of the particular command.

Common Errors and What They Mean

Message Likely cause
System error 5 has occurred. Access is denied. Command Prompt is not elevated, or the signed-in account lacks administrator rights
The user name could not be found. Misspelled name, the account is a domain account, or the name should be quoted because it contains spaces
The user account could not be deleted because it is currently logged on. The target account has an active session; sign that user out or delete from another session
The user name could not be found (on a domain-joined PC) The name exists in the domain, not the local SAM; use Active Directory tools
The command completed successfully, but the account still appears somewhere Settings, lusrmgr.msc, and third-party tools may cache or display stale information; re-check after a refresh or reboot

A subtler failure mode is deleting the wrong account because of a near-duplicate name (for example, jsmith versus j.smith). Because there is no confirmation prompt and no undo, verifying the exact name with net user beforehand is worth the extra step.

Why Windows Works This Way

The design reflects Windows' security model. Local accounts are security principals identified by SIDs, and the SAM is a protected database that only administrators can modify. net user is a thin client over that database: it does not bypass permissions, it respects them. The same model explains why the command has no built-in "are you sure?" prompt—command-line tools are designed for scripting, where interactive confirmation would break automation—and why Microsoft's own guidance favors dedicated settings interfaces for everyday users while keeping command-line tools for administrators.

The separation between account and profile is also deliberate. Profiles contain arbitrary user data, and Windows does not assume that revoking sign-in access should destroy files. That separation is why account deletion and data deletion are separate administrative decisions, and why a complete offboarding process addresses both.

Practical Summary

If the search question is taken literally—how does CMD work to delete a user account—the mechanism is straightforward: net user /delete from an elevated Command Prompt removes a local account from the SAM, including its group memberships, but leaves the user's files on disk. The command's apparent simplicity hides three constraints that account for most real-world failures: elevation is required, only local accounts can be targeted, and the action is irreversible without a restore point or backup. For automation or clearer error reporting, Remove-LocalUser in PowerShell is the modern equivalent. For domain accounts, use Active Directory tools; for Microsoft accounts, use Settings. And whenever data might still be needed, archive the profile folder before deleting the account rather than after.