If you have to remove files and subfolders from a folder, you must use different tools. For example, you can use the rmdir (remove directory) a tool with Command Prompt to delete folders recursively, or you can use the Remove-Item cmdlet on PowerShell. This guide will teach you two ways to quickly delete folders with Command Prompt and PowerShell subfolders.
Delete folders with subfolders on Command Prompt Delete folders with subfolders on PowerShell
Delete folders with subfolders with Command Prompt
To remove a subfolder from a folder with commands on Windows 11, use these steps: Once you complete the steps, the command will remove a subfolder from a folder and files from Windows 11. In the command, replace PATH\TO\FOLDER-NAME with the folder path and the folder name to delete. This example removes the “files” folder:
This example removes the “files” folder, subfolders, and files:
This example removes the “files” folder, subfolders, and files without prompting for confirmation:
The /s option deletes the folder and its content in the above command, but it prompts confirmation. The /q option ignores the prompt and deletes the folder recursively.
Delete folders with subfolders on PowerShell
To recursively delete an entire folder (with subfolders) on PowerShell, use these steps: After you complete the steps, the command will remove the folder and its contents with or without a prompt, depending on the command. In the command, replace PATHTOFOLDER-NAME with the folder path and the folder name to delete. This example removes the “files” folder:
This example removes the “files” folder:
The -Recurse option deletes the folder and its contents without prompt confirmation. The -Force option erases special items, including read-only or hidden files, but it’s not required. All content on this site is provided with no warranties, express or implied. Use any information at your own risk. Always backup of your device and files before making any changes. Privacy policy info.