Deleting Locked Fies Manually - Windows CMD. - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Computer Support Topics (https://www.supportforums.net/forumdisplay.php?fid=4) +---- Forum: Microsoft Support (https://www.supportforums.net/forumdisplay.php?fid=5) +---- Thread: Deleting Locked Fies Manually - Windows CMD. (/showthread.php?tid=435) |
Deleting Locked Fies Manually - Windows CMD. - UID=0 - 10-07-2009 Using Cacls in Windows CMD to modify ACLs. Or, in simpler terms, taking control of files/folders. This is very similar, to the thread I posted about taking control of files/folders, using Windows Explorer. The method here though, is quite different as it uses the CMD program within Windows XP and I just thought that it would have been a bit too much, and maybe a little confusing, to have included it, in the other thread. It's not always possible to delete certain files, if they are locked in some way, and being used by another process or user. There are ways of getting around this, but it doesn't work for 100% of files, but it will let you delete or modify many. There is the program called: cacls. Which allows you to take ownership of files, normally restricted by the System. This only works for the NTFS file system OS though. This means that there could be a possiblity that it may also work, for Windows Vista and Windows 7. Open the CMD program and type - [Not case sensitive]: cacls /? and hit return, to display the cacls help menu. To save a text file of the help menu, at the command prompt, type: cacls /? > FileName.txt and hit return, to save a text file of the help menu, to: C:\Documents and settings\YourName\My documents\ as an example, but it will save the file to the default folder for your documents, unless you specify a folder path at the command prompt. It also has to be an existiing folder, as it doesn't seem to work, if you try to create a new folder. [NOTE: When you open the saved text file, if you add so much as even one space to it, and then save it, the next time that you open the file, the formatting and spacing will have been completely removed. This is also the same, if you copy and paste the text to another text file]. This means that if you want to keep a log of what files you change, unless you leave them as they are, you will have to respace them by hand. It shouldn't take that long though, a few minutes perhaps, as there probably won't be that many entries in the list. [NOTE: It may be a good idea, if you are going to try this, to make a copy of an unimportant text file, or something similar, to try it out with, the first time that you do this]. At the command prompt, type: cacls FileName.ext and hit return to display the ACL - [Access Control Lists]. Example: It may show a group of entries in the list, ranging from Administrator to System. C:\Documents and settings\YourName\My documents\FileName.ext YourPCName\Administrator:F NT Authority\System:R BuitIn\Users:R BuiltIn\Administrators:F Where: F Full Control R Read W Write C Change [Write] N None At the command prompt, type: cacls FileName.ext /g Administrator:f and hit return. Once again at the command prompt type: cacls FileName.ext and hit return again, to display that only Adminstrator, is left in the ACLs. C:\Documents and settings\YourName\My documents\FileName.ext YourPCName\Administrator:F You can verify this, by using Windows Explorer. Right click on the file and select Properties and then click on the tab for Security to confirm this. If you want to add a user or group that has been removed from the ACLs, type the following, with the relative Usererm parameters at the command prompt: For example: cacls FileName.ext /e /g system:r to add the user System to the ACLs, with read only access rights. So if you type, once again at the command prompt: cacls FileName.ext and once again hit return, you will see that the ACLs will look like: C:\Documents and settings\YourName\My documents\FileName.ext YourPCName\Administrator:F NT Authority\System:R To get it back to just yourself in the ACLs, at the command prompt type: cacls FileName.exe /g Administrator:f And once again, type: cacls FileName.ext to verify that you are the only entry left in the list. For those files which cannot be deleted after making modifications, you can use Unlocker to do it instead. http://ccollomb.free.fr/unlocker/ Once again, I hope that some of you, may have found this to be useful. RE: Deleting Locked Fies Manually - Windows CMD. - mausingh - 11-20-2010 This problem is well known and finally I found solution for it: http://pathtoodeep.com RE: Deleting Locked Fies Manually - Windows CMD. - haphazard - 11-22-2010 Lmao im going to use this in my virus.. Thanks OP! RE: Deleting Locked Fies Manually - Windows CMD. - AceInfinity - 11-25-2010 mausingh Wrote:This problem is well known and finally I found solution for it: I dont think you've read this properly. It's a tutorial, not an issue he's trying to solve. Old Dirty Bastard Wrote:Lmao im going to use this in my virus.. Thanks OP! This is not HF, discussion about viruses are not supposed to be on Support Forums. Unlocker is a good program though. I use this as well. I used to hate having to look through all the processes and find out which process was using a file that I wanted to be deleted. Or rebooting my computer. |