How to delete a folder that is being used by the system [duplicate]
I am trying to delete this folder, C:\Windows\System32\catroot. I am using the application, LockHunter and it is telling me that it is being used by the system and the svchost.exe and it is preventing me from deleting it. How do I delete this folder?
Thank you for your help and support!
This answer is addressing the "Just wondering, if I were to delete a system folder how would I do it?" comment. As the other comments note, you probably shouldn't delete the catroot
folder.
Some programs, such as Unlocker, are able to forcibly close handles or end the process. However, forcibly closing handles is a very dangerous thing to do with possible data corruption and other weird side effects. And you obviously can't end the system process.
At the end of the day, what you need to do is modify the file offline. In other words, you need to do it while the OS is not running. To this end, you can boot off a different OS, such as a Linux Live CD/USB, or you can connect the hard drive to a different machine.
Be warned that deleting or modifying system files may cause instability or even cause it to be unable to boot. Make sure you do your research properly, have backups, and consider renaming or moving instead of deleting, so you can restore later. Also, "I thought it was a virus" is a very bad reason to just go and delete something without good research or a second opinion.