The Windows 11 operating system has several changes when it comes to the design and look when compared to the previous version. But it retains almost all the functionalities that millions or users of the operating system have become accustomed to.
Microsoft has offered a great tool in the form of File Explorer which makes it very easy to manage files and folders on the computer. It’s also quite easy to delete files and folders from the file explorer but there are other ways to perform the task.
Users can delete files or folders, including data stored inside a folder, using simple commands. There are different tools for the command operations but for this guide, we will be focusing on PowerShell.
In this step-by-step guide, we will show you how to quickly and easily delete folder along with its contents on Windows 11 operating system using the PowerShell command-line tool.
How to delete folder with subfolders in Windows 11 using PowerShell
Step 1: Open the Start Menu on your Windows computer.
Step 2: In there, search for “PowerShell” and select the “Run as administrator” option.
Step 3: When the PowerShell opens, enter the following command:
Remove-Item PATH\TO\FOLDER
In the above-mentioned command, replace PATH\TO\FOLDER with the actual folder and its content that you want to delete from the system.
Step 4: Type and enter the following command to delete an empty folder:
Remove-Item -Recurse -Force PATH\TO\FOLDER-NAME
The -Recurse option means that the user wants to delete the folder and all its contents without the confirmation prompt and the -Force option indicates that the action will be performed even when the folder or files are read-only and hidden, or any other such special cases.
That’s it. Once you have followed the above-mentioned step-by-step guide, then the selected folder and all the contents within the folder will get deleted from the system. If you chose to use the -Recurse option, then the data will be deleted without the confirmation prompt.