Search This Blog

Tuesday, February 8, 2011

Windows won't let you delete a file? Use the command prompt.

If you’ve ever seen the error message that you can’t delete a file because it’s currently in use, it is still possible to delete that file.  There’s a way to delete it through the command prompt using the following steps (in Windows 7):

1.   Type ‘cmd’ into the search bar and then right-click on ‘cmd.exe’ and choose ‘Run as Administrator’.
2.      Go to the folder you want to delete a file from. Click on the Address-field to reveal the actual folder path.
3.      Highlight the portion of the path after the Colon (:).
4.      Right-Click the highlighted part, and choose Copy (or Press Ctrl+C).
5.      Go back to your Command-Window and type: ‘CD\’ (This will open the Root Folder).
6.      Paste in the path using Right-Click, Paste (Ctrl+V will NOT work).
7.      To make sure you are in the correct folder you can type: ‘DIR’. This will show you the folder contents.
8.      To delete the file, type: ‘DEL[filename] /F /Q’.
The F means: Delete File even IF it’s reported as Read Only.
The Q means: you don’t have to Confirm.
If you want to delete all files in the folder, you can use wildcards instead of Filename
For example: DEL *.* /F /Q

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...