How to Delete a Write Protected File
Level of difficulty:
There are some programs or files that you have deleted from your machine that sometimes fail to be removed completely, leaving behind some write-protected files on your computer. You can’t just delete write-protected files in Windows. You will always encounter a dialog box, telling you that the file must be write-protected and that Windows can’t delete it, by doing so.
- DOS/Command prompt
- Microsoft Windows Operating System
- Write-protected file
In order to bypass the protections provided by your Operating System for the file, you can utilize the command prompt. You can launch the command prompt in Windows XP by clicking the 'Start' button. The Start button will direct you to the Start Menu. Select Run form the Start Menu
In the 'Run' window, key in 'cmd' or 'cmd.exe' on the 'Open' text field and then click the 'OK' button.
The command prompt will then be launched. Change the directory to where the write-protected file is located. Make use of the cd or change directory command to change the directory.
Check if the file is still in its directory and if it is write-protected. Make use of the attrib command to check the files attributes. Syntax: D:\Files\attrib nameofthefile.exe. You will notice the file to be listed in the directory this way: A R nameofthefile.exe.
Still at the DOS prompt, key in 'C:\Files\attrib –r nameofthefile.exe' to remove the write-protection.
You can now delete the file by using the del or delete command. From same path in the command prompt, key in: del nameofthefile.exe.
Make sure that you have successfully deleted the file by checking if it still exist in its directory. To see if the write-protected file is still there, make use of the dir or directory command. From the DOS command prompt, type C:\Files\dir to list the contents of the directory. If the write-protected file is no longer listed there, then you have successfully deleted it.
You can now go back to Windows by making use of the exit command. At the DOS command prompt, key in exit and then hit enter to close the command prompt window and return to Windows.