How to Remove Deleted Ghost Files
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.
Things You'll Need
- Boot DVD (optional)
Click on the "Start" button. Select "Run".
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.
Tips & Warnings
- Use a virus scanner before attempting any of the methods above to delete a ghost file. Very often the problem can be solved with a virus scan alone.
- Users may choose to use other software to scan and repair the file system. Checking the disk for errors is usually the best option to start with since it is the least invasive.
- You may want to make a bootable dvd to delete the ghost file. This has the added benefit of avoiding the entire process of disabling locked files. You may need to run a program to cleanup your computer's boot process afterwards
- Be very careful when using programs like msconfig or regedit. These programs can create a lot of problems if used incorrectly. Always consult an expert if needed. Be careful when deleting files. While a ghost file may be annoying, deleting a critical file can also cause your system to crash. Consult an expert if you are unsure. Do not stop the program "chkdsk" while it is running. Doing so can cause additional file corruption.
References & Resources
- 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