Monday, April 9, 2012

Delete A Writeprotected File







Programs you've deleted from your computer sometimes fail to uninstall completely, leaving behind unwanted write-protected files on your machine. If you try to delete a write-protected file from Windows, a dialog box appears, asking you to confirm that you want to move the file to the recycle bin. When you try to delete the file with the command prompt, you see the message "Access denied." Fortunately, there's a way to get rid of a write-protected file once and for all.


Instructions


1. To bypass the protections afforded by the operating system and delete a write-protected file by hand, use the command prompt. In Windows XP it's located at c:\Windows\System32\cmd.exe.








2. Run the command prompt and change to the directory where example.rtf (a sample file for the purposes of these instructions) is located:


cd directory (use the name of the applicable directory)


3. Check to see that the file still exists and that it is write-protected:


attrib example.rtf


You will see the file listed this way in the directory:


A R example.rtf


4. Still at the command prompt, remove the write-protection.


attrib -r example.rtf


5. Now delete the file. From the command prompt, type:


del example.rtf


6. Double-check to make sure the file has been deleted:


dir example*


You should no longer see example.rtf listed.


7. Return to Windows by typing at the prompt:


exit

Tags: command prompt, write-protected file, attrib example, delete file, delete write-protected, delete write-protected file