ForceDel - a tool that deletes locked files

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

It works here. I'll take a closer look later. The names are double-null terminated, it's done in AddFile()
Can you post a command line that generates that error?

Known bugs:
- unlocking w/out deleting doesn't work(fixed)
- deleting comments sometimes doesn't work(EDIT:fixed)
- sometimes, when specifying a path w/out quotes, the whole thing doesn't work (fixed)
Giovanni
Member
Member
Posts: 154
Joined: 2005-03-23, 18:28 UTC

Post by *Giovanni »

OK, simple test. Hope that this is enough information for you:

Code: Select all

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>dir Read.me
 Volume in drive C is LOCALDISK
 Volume Serial Number is 0000-0000

 Directory of C:\

16/11/2007  17:22             1,071 Read.me
               1 File(s)          1,071 bytes
               0 Dir(s)   xxxxxxx bytes free

C:\>attrib Read.me
A          C:\Read.me

C:\>ForceDel.exe /W3 Read.me

Code: Select all

Trying to delete:
 'C:\Read.me'...
failed(1026)

Trying to unlock the files

Trying to delete:
 'C:\Read.me'...
failed(1026)

Couldn't delete all files.
I tried various combinations of switches - just as I was about to submit this post I tried:

Code: Select all

ForceDel.exe /NB C:\Read.me
It worked! I have changed my parameters in Total Commander's button bar shortcut to ?/W3 /NB "%P%N" and I get constant success.
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

There's a minor bug - I changed the default /B to /MB..but just for GUI. Fixed. It's not the main problem though.

I see a strange thing in your output. This version still requires you to provide full path to the file in the command line (and it's not going to change anytime soon).

Code: Select all

ForceDel.exe /W3 Read.me
should return

Code: Select all

GetFileAttributes(Read.me) failed with: 2
, but it got "C:\". Is it your command line interpreter?

Anyway, as I said, I'll review the code later.
Giovanni
Member
Member
Posts: 154
Joined: 2005-03-23, 18:28 UTC

Post by *Giovanni »

Sorry, you are right. Well spotted! It should have been:

Code: Select all

C:\>ForceDel.exe /W3 C:\Read.me
It's late, I was doing lots of tests and I copied the wrong one. Oops!
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Small update.
Changes:
[+] New warning level - "stay quiet"
[!] Unlocking w/out deleting doesn't work(fixed)
[!] Deleting comments sometimes doesn't work
[!] Sometimes, when specifying a path w/out quotes, the whole thing doesn't work
[+] Unlocking files is almost exactly 20% faster
[+] Some other, minor changes

I have a good news. I found a major design flaw in NTSystemInfo library that makes unlocking files in ForceDel so slow. It can be 10-50 times faster w/out kernel tricks. For the last month I've been fighting with ntdll thread security issues in order to get it working...without success. Today I decided to leave it and release a ~month old version with just a slight modification that gives these 20%. I'll be now working on the other things from the TODO list..but I'll return to fixing this issue, probably c.a. month later. I have a well thought method that will circumvent the thread security issues..but I don't know what I will find then :?. That's why I won't try it now.
stanlim88
New Member
New Member
Posts: 1
Joined: 2008-01-12, 10:21 UTC

Post by *stanlim88 »

Hi,

Need some help. I got below error even using Forcedel to erase the file:

ERROR: GetFileAttributes(autoinstallgui_fc.qmh) failed with: 2
Couldn't delete all files.

Pls kindly advise how I could delete the file. Tks!
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

stanlim88 wrote:Hi,

Need some help. I got below error even using Forcedel to erase the file:

ERROR: GetFileAttributes(autoinstallgui_fc.qmh) failed with: 2
Couldn't delete all files.

Pls kindly advise how I could delete the file. Tks!
m^2 wrote:ForceDel 1.5
(...)
[-] Relative paths support. Yes, you have to always specify full path.
I think I should modify GUI toindicate that full path is needed.
Giovanni
Member
Member
Posts: 154
Joined: 2005-03-23, 18:28 UTC

Post by *Giovanni »

I missed the last update! Testing shows negligible difference in speed on my system.

I have found that if a file or directory is locked by a service, ForceDel cannot delete it (but unlocker can). The log shows: 0 handles to close. Any ideas?

Is it possible add an option to log results to a file?
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Giovanni wrote:I have found that if a file or directory is locked by a service, ForceDel cannot delete it (but unlocker can). The log shows: 0 handles to close. Any ideas?
Unlocker works in a different way. I'm not sure, but I think that it doesn't even search for handles.
I have only one idea. It may be something with privileges. I'll try it.
Giovanni wrote:Is it possible add an option to log results to a file?
Yep.
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

beta 3.
[+] Multilanguage support.
[~] By default on the center of the screen.
ADDED:
If somebody wants to translate it, contact me first. This way you'll avoid doing something that's done already.
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

QuickFix
[!] Fixed some translation related issues.
[+] German language file.
ADDED:
Known bugs:
Position (and size) are stored in the .ini file. If you have the .ini, ForceDel window will keep it's old size. Temporary solution: delete the [position] section from the .ini file and restart ForceDel.
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Note:
The configuration file can be located in 2 places:
- By default, user application data, in ForceDel subdirectory.
- User can move it to FD main directory, then FD will be portable.
I intend to write a configuration dialog (with "portablize me!" button), so soon you won't need to care about it ;)
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

ForceDel 1.7 beta 4.
Changes:
[~] Unlocking files should be faster...much faster :))
[+] Russian language
[+] Logging to file (LogFile= entry in [configuration] section of .ini file)
[+] .Ini setting for default warning level (WarningLevel= in [configuration])
[!] Language corrections
TODO:
Code cleanup. The faster unlocking code is totally unreadable, but I wanted to release the new version today...

Edited.
User avatar
byblo
Senior Member
Senior Member
Posts: 270
Joined: 2005-02-20, 21:13 UTC
Contact:

Post by *byblo »

Can this program delete hidden executables running in hidden path, like trojans ?
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

I have no idea how do they hide themselves. I wrote no specific code for it, so probably it can't. If you provide some more info, I will try to do this :)
Post Reply