The command to delete a folder in Command Prompt is rmdir, or its shorter name, rd. Without extra options, it removes an empty folder. For a folder with files inside, add /s to remove those files and any subfolders too.
Deletion through rmdir skips the Recycle Bin. Check the full path and copy out anything you need before you approve the deletion. Windows 11 follows the same syntax as Windows 10.
In this guide
1. Open Command Prompt and check the folder path
Press Windows+R, type cmd, and press Enter. Start with an ordinary window for your own files. You don't need administrator permission just because you're using a command instead of File Explorer.
On Windows 11, Terminal can open a PowerShell tab by default. Use the Command Prompt opening options if the window starts with a PS prompt. The commands in this guide are for cmd.exe.

In File Explorer, open your target folder and copy its full location from the address bar. The example path in this guide is C:\FolderToRemove; replace that entire path with your own folder's location.
Use quotation marks around the path, including when it has no spaces. That way, the command also works when you use a name such as Old Project. Don't substitute a drive root such as C:\ for the example folder.
Type this inspection command first:
dir /a "C:\FolderToRemove"
The /a option shows hidden and system items too. Check the directory heading and the file list: both should match your intended folder. If you see files you didn't expect, stop and check the path.
2. Remove an empty folder without extra switches
For a folder that contains no files or subfolders, enter:
rmdir "C:\FolderToRemove"
After removing the folder, cmd.exe usually displays its prompt again with no success message. Refresh File Explorer in the folder that contained it to check that it's gone. Check for errors too; silence alone doesn't mean it worked.
If you see The directory is not empty, the plain command hasn't removed the folder. It can contain a hidden item even when File Explorer looks empty. Review the dir /a results before deciding whether its contents can go.
Microsoft says the /s switch removes the directory tree, including subfolders and files. That includes the selected folder itself; it doesn't leave an empty shell behind.
The shorter command rd performs the same job. The shorter spelling isn't safer or more powerful. Choose either name, stick with it, and check the result.
3. Delete the folder and its contents with confirmation
Once you've checked that the folder contains only files you want to remove, use:
rmdir /s "C:\FolderToRemove"
The /s option includes the contents and subfolders. Read the confirmation prompt and check the folder it names before answering. Enter Y to continue, or N to cancel on an English Windows installation.
I'd keep that confirmation for a one-time cleanup. It gives you a final chance to notice a copied path that points at the wrong project or a different drive holding a folder with a similar name.
After the command finishes, check the parent folder again. If the folder remains or you see an access error, deletion didn't finish as expected. Some items might already be gone, even if another item stopped the command from finishing.
Adding /q alongside /s skips the confirmation. That can help in scripts you've checked carefully, but it offers no benefit when you're deleting this folder by hand. Leaving it out keeps the final decision visible.
If the shell is actually PowerShell, switch to Command Prompt before continuing. PowerShell gives rmdir different command behavior; the PowerShell folder-removal guide explains its preview option and syntax.
4. Leave the directory before removing it
Command Prompt can't remove the directory it is currently using. This also matters when another open command window is sitting inside the folder you're trying to delete.
Type cd by itself to display the current directory. If you're inside the target folder, move to its parent with:
cd ..
Repeat that move if you're still inside one of its subfolders. Alternatively, cd /d followed by a quoted, existing folder path changes both the drive and directory. Choose a location outside the folder being removed.
Close another command window using the folder, or change its directory too. Check the removal command's path and retry it. If leaving the folder fixes the error, the current directory was the problem; extra deletion options weren't needed.
A message about another process using a file can also come from an editor, archive utility, or other app. Save any pending edits, then close the file and retry, rather than running the same command over and over.
5. Handle a path error or denied access carefully
For The system cannot find the path specified, return to File Explorer and copy the location again. Check the drive letter, spelling, and quotation marks. A disconnected external drive needs reconnecting before its path can work.
For Access is denied, first check that this is a personal folder you intended to clean up. Close apps using it. A school or work folder can have access rules that need its administrator's help rather than a more powerful deletion command.
Reopen the window with Run as administrator only if the folder is yours to manage and its permissions require it. Check the path again in the new window before retrying. Administrator access won't correct a wrong folder path.
Use the supported uninstaller for an app rather than deleting its program folder. For a personal folder that still won't delete, give support the complete error and say whether the folder is local, external, or shared.
If important files were removed accidentally, stop writing to that drive and check a separate backup or file-recovery service. The command doesn't provide an Undo button that restores a deleted directory tree.
The Short Version
Inspect the exact path with dir /a. Use plain rmdir for an empty folder, or rmdir /s when its contents can be removed too. Keep the confirmation, leave the target directory first, and check the parent folder afterward.
Checked December 4, 2026.







