There are files and folders that are encrypted by the operating system and these can’t be deleted by usual means. A folder containing viruses may also be locked and they cannot be deleted either. However, by using the command prompt and a few simple commands these files and folder can be deleted without having to know the system admin password.
Here’s a step by step guide to deleting a locked file in a Windows 10 PC.

Step 1
Open 'Command Prompt'

Go the 'Search bar' located on the bottom right corner of your screen and type in the words ‘Command prompt'. Click on the 'Command prompt' app icon from amongst the search results.



Step 2
Enter the First Code

In the command prompt window type in the code ‘cd*space*/d’ followed by a space and the location path of the locked file or folder. If you don’t know the location path then right click on the file or folder and view its properties, the location should be available there. Once you have entered the code followed by the location, press enter.



Step 3
Enter the Second Code

Now enter the code ‘dir*space*/x’ and press 'Enter'. Various lines of coding should automatically get generated following this.



Step 4
Enter the Last Code

At the end of the auto-generated code type in the following code ‘rmdir*space*/q*space*/s*space*’ and enter the name of the folder in all caps followed by a ‘~1’. Once you have entered the code it should look something like this considering your folder is named ‘abc’: rmdir /q /s ABC~1. Press 'Enter' once done.



Once you have entered all the three codes successfully the locked file or folder should be automatically deleted from your PC.