How to delete an access denied folder from cmd

Micrososft computers with Windows operating system offer the administrator many licenses to be able to take actions such as moving files, copying them and even deleting them. However, it may happen that we are not the main admin of the computer we are using and we need to delete a file . How could we do in that case?

In the same way, the case may arise that access is denied for certain files or simply does not allow us to delete them. For those cases we will have to resort to the System Symbol or CMD , and with a few simple commands we can eliminate these files that refuse to be deleted.

Generally, when we try to delete a file or folder and it does not allow us to delete it, we will get a message with the following error: The file cannot be deleted: access denied. The source file may be in use .

This is because the recycle bin does not understand mounted volumes. That is, when you try to delete a path on drive C: for example, Windows Explorer interprets that the file or folder is on that drive but fails and therefore cannot move it to the recycle bin.

If this happens to you constantly and you don’t know how to fix it, in the next article we will explain step by step how to easily delete a folder with access denied from cmd.

Delete undeletable files from CMD

This is one of the best CMD commands for Windows , since you can delete any file that refuses to be deleted. The first thing you should do is click on the start button and in the search bar type CMD or Command Prompt.

You can right click on the command prompt and select the run as administrator option if you want to have access to everything. Otherwise you can skip this step and it will work anyway. The commands must have the following formula: DEL / F / Q / AC: \\ Users \\ Enter your username \\ Enter the file location here \\ Enter the file name here

  • Del: support to delete
  • / F : support for force delete
  • / Q : support for not showing notifications such as Do you really want to delete the file?
  • / A: This command represents the attribute of the file, such as to archive or hidden.
  • / C : Represents the main drive of the disk.

this is useful for removing viruses that cannot be removed. So that we write in CMD the following command: DEL / F / Q / AC: \ \ Users \ \ PCWebtips \ \ Desktop \ \ virus.exe and press enter to finish the action.

Another alternative to delete files with access denied

When deleting files you can use the key combination Shift + DELETE. This way you will skip the process of sending it to the trash and the files will be permanently deleted.

You can also open a CMD command window in Windows 10 and use the Rd / s / q command to delete files or folders that cannot be deleted regularly. It is important to note that both methods will delete the files permanently.

Commands to delete files in Windows

With the command prompt, you can do anything from opening a web page to removing malicious files, viruses, or locked folders. However, there are multiple scenarios that can occur such as deleting a file or folder, deleting several, or deleting read-only files.

Depending on what you need, it will be more useful to execute one command or another. For this reason we will explain the different ways to delete files from CMD so that you can decide whether to delete one or more files and folders.

Command to delete a file

Open CMD and use the “cd” command to go to the folder of files you want to delete and run the “DEL” command to delete. An example of the command would be like this: DEL / F / A < file.extension > the F parameter will force the file to be deleted while A will delete only the files marked by Windows.

Command to delete multiple files

To delete multiple files you can use the wildcard “*” which is ideal for deleting many files with specific names. c: / Users / vamsi / Desktop / del> * c: / Users / vamsi / Desktop / del> * Are you sure (Y / N) AND c: / Users / vamsi / Desktop / del>

 

by Abdullah Sam
I’m a teacher, researcher and writer. I write about study subjects to improve the learning of college and university students. I write top Quality study notes Mostly, Tech, Games, Education, And Solutions/Tips and Tricks. I am a person who helps students to acquire knowledge, competence or virtue.

Leave a Comment