Tuesday, January 28, 2014

Delete "Not Existing" files in Windows 7

Sometimes even after we delete a file or move it, its ghost copy might still remain in the original folder. The ghost file might have been created due to a race condition. When we try to delete the file, we get an error stating "Cannot Delete the File, The file does not exist".

In that case, use a command prompt in windows and navigate to the folder. Use "dir /x" command to see if the ghost file is being listed. As per the reference [1], if you can identify the 8.3 format filename in the output, you can use it to delete the file using "del <filename>" command from the prompt. An easier way would be to use wildcard filename to delete the ghost file. The wildcard command might look like " del *file.txt".


References:
1. http://superuser.com/questions/388860/cant-delete-files-that-do-not-exist-but-appear-in-my-download-directory

No comments:

Post a Comment