A ghost file is a file that cannot be deleted by normal means. Users will typically receive an error similar to "cannot delete folder" or "cannot delete file". Usually, the problem with a ghost file is caused by system corruption, the system locking the ghost file, or a virus immediately recreating the ghost file once it is deleted. The solution usually requires the user to repair the system file structure, make a bootable DVD or find other means to access the ghost file before the system boots completely, or delete the virus in question.
Click on the "Start" button. Select "Run".
Video of the Day
Type "chkdsk /f [drive]:". Replace [drive] with the drive letter where the ghost file is.
Wait for the Check Disk program to complete its scan. This may take some time, depending on how fast your computer is.
Delete the desired ghost file.
Delete Locked Ghost Files Before Bootup
Write down the location and name of the ghost file in question.
Place your installation CD into the CD/DVD ROM drive. Restart your computer and boot from the installation CD. You may need to configure your computer to boot from the CD/DVD ROM drive first.
Click on "Repair your computer" if you are running Windows 7 or Vista. Press "R" when the "welcome to Setup" screen appears if you are running Windows XP.
Select the installation of Windows with the ghost file on it. For computers running XP, you may also need to enter the administrator password if there is one.
Select "Command Prompt" for machines running Windows 7 or Vista. If you are running Windows XP, you should be given the command prompt automatically.
Type in "cd [path]" into the command prompt, where [path] is the location you wrote down from Step 1. Hit enter.
Type "del [ghost file]", where [ghost file] is the name of the ghost file in question. Reboot the computer.
Unlocking Files Using "msconfig"
Hold down the Windows key and press "R". Type "msconfig" and hit the "enter" key.
Select the tab labeled "Startup".
Uncheck the boxes that correspond with any ghost files you are attempting to delete. Reboot the system.
Delete the desired ghost file.
Unlocking Files Using “regedit”
Hold down the Windows key and press "R". Type "regedit" and hit the "enter" key.
Select "Yes" in the dialogue box titled "User Account Control" if present.
Press Ctrl + F. Type in the name of the ghost file and hit "enter".
Press F3 if the first search is not the exact name of the ghost file in question.
Backup the registry entry by selecting "File", then "Export". Save the entry someplace easy to access and remember. This action will help protect your system if you prevent a critical file from loading.
Press the delete button and confirm the deletion.
Continue to scan for additional entries, repeating steps 4 through 6. Delete all occurrences of the file in question. Once this is completed, reboot the system and delete the desired ghost file.
- Microsoft Support: Error message—The File or Directory Is corrupt
- Microsoft Support: How to locate and correct disk space problems on NTFS volumes in Windows XP
- Microsoft Support: How to Install and Use the Recovery Console in Windows XP
- Microsoft Windows: What are the system recovery options in Windows Vista?
- NU2 Productions: Bart’s Preinstalled Environment (BartPE) bootable live windows CD/DVD
- EMCO Software: MoveOnBoot Overview