If the File menu is not visible in My Computer or Windows Explorer, press the Alt key to make the menu bar visible, including the file menu. Some documents and folders may be protected from deletion through encryption or password protection. In this case, you may be asked for a password to decrypt or remove the password protection.
A file may be set as read-only , meaning the user can only open it for viewing and not modify or delete it. When trying to delete a read-only file, you get a message stating the file is write-protected and cannot be deleted. You need to modify or write permissions to delete the file.
Some files may only be deleted with administrator permissions. To delete these files, you would need to have administrator rights on the computer. If you are using a work computer, the technical support staff often are the only users with administrator rights on the computer. Another possible cause of problems with deleting a file or folder is a virus or malware infection. Viruses and malware can prevent files or folders from being modified or deleted. If this is the case, you need to remove the virus or malware infection to delete the affected file or folder.
See our uninstalling a program steps for help with uninstalling deleting software programs from the computer. If you've deleted a file by mistake, you can see our page on how to restore a deleted file for further information on recovering a deleted file. If you are new to the command line, you may also want to read through the following pages first. MS-DOS users can delete files using the del command. See this page to get additional information and help with this command.
Below is an example of how to use this command. As seen in the example above, when deleting a file, you need to enter the full file name , including the file extension. You can also use wildcards to delete multiple files or a group of files, as shown in the example below. In the example above, this command would delete all text files that end with a.
See either of these links for additional information about these commands. Below is an example of how to use this. If the directory is full or has other subdirectories , you get an error message. To delete a full directory, you need to use a switch with the above example. See our deltree command or rmdir command for additional examples and switches. To delete a subdirectory , subfolder, folder within a folder, or directory within a directory, use a command similar to the example below.
These tips will help you understand the terms and some basic rules of the commands that will be used further in the article. When typing file name, notice whether there is a gap space in it. For example, if the folder name has no space in it, it can be written as-is.
Here is an example:. Another 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. 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.
This is called a recursive action. Furthermore, you must also know how to change your working directory when inside a Command Line Interface. Use the command cd to change your directory, followed by the correct syntax. Here are some examples:. One last thing that might come in handy is being able to view what content is available in the current working directory.
This is especially helpful so that you type in the correct spelling of the target file or folder. 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. Let us start with the very basic commands and work our way up from there for Command Prompt.
We recommend that you use Command Prompt with administrative privileges so that you do not encounter any additional prompts that you already might have. Del and Erase commands in Command Prompt are aliases of one another.
Meaning, both perform the same function regardless of which one you use. These can be used to remove individual items files in the current working directory. It functions using file filters — this lets you include and exclude files based on its extension. Before starting the deletion process, the program allow you to pre-analyze the chosen search criteria. So, if any unwanted result is found, you can correct it before actually executing the task. You might have attempted to open the command prompt and encountered a lot of cd commands trying to access a folder.
The good news is that you can save lots of time by using Explorer to open a command prompt inside a folder. You just need to hold shift, click right on a folder and the context menu will present the option. Most probably, you might have been tapping the up key to access your earlier commands; this can be tiresome if you are attempting to get a specific command.
Another method you can use to see your earlier command is using the donkey command. If you lost data on your computer, don't worry! You still have the chance to get lost data back. To recover files from the computer, you can have tried the file recovery tool. Generally rated 4.
0コメント