Tip: Use the Tab button to automatically complete paths and file/folder names. Use either of the following commands to do so: Remember that it cannot be used to delete the directories (folders) themselves. These can be used to remove individual items (files) in the current working directory. Meaning, both perform the same function regardless of which one you use. ![]() Del/Erase command in cmdĭel and Erase commands in Command Prompt are aliases of one another. We recommend that you use Command Prompt with administrative privileges so that you do not encounter any additional prompts that you already might have. Let us start with the very basic commands and work our way up from there for Command Prompt. How to remove files and folders using Command Prompt Both of these are going to be used to delete content from a computer. Now that we have the basic knowledge, let us show you how you can delete files and folders using the command line on a Windows PC.īy default, there are 2 command-line interfaces built into Windows 10 – Command Prompt and Windows PowerShell. To view the contents of the current working directory in Command Prompt and PowerShell, type in Dir. This is especially helpful so that you type in the correct spelling of the target file or folder. One last thing that might come in handy is being able to view what content is available in the current working directory. Move to a precise folder regardless of your current working directory: cd /d "DriveLetter:\Path\FolderName" For example, cd /d “C:\Users\Subhan\Desktop”.Move to a folder within the same working directory: cd "NameOfFolder".Use the command cd to change your directory, followed by the correct syntax. This is called a recursive action.įurthermore, you must also know how to change your working directory when inside a Command Line Interface. Having said that, you will need to use the dedicated options in the command to remove content from within a folder along with the main folder itself. ![]() Here is an example:Īnother thing to remember is that you might see different outcomes while removing folders that are already empty, and folders that have some content in them. However, if there is a gap in it, it will need to be written within parenthesis (“”). For example, if the folder name has no space in it, it can be written as-is. When typing file name, notice whether there is a gap (space) in it. The most important thing to remember here is the syntax of the path and file/folder name. These tips will help you understand the terms and some basic rules of the commands that will be used further in the article. Here are some important things for you to understand before we dig into removing files and folders using Command Prompt and Windows PowerShell.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |