xdelete

external links: index . projects . home

in-page links: warning - preamble - updates - downloads - help - alternatives - end - warning

BIG WARNING

BIG WARNING: IT CAN NOT BE REPEATED ENOUGH!

MASS DELETING OF FILES FROM YOUR DRIVES CAN KILL YOUR OPERATING SYSTEM, OR DELETE VERY IMPORTANT FILES, PUTTING YOU IN DEEP TROUBLE.

BE VERY SURE YOU KNOW WHAT YOU ARE DOING! ONE SLIP AND YOU COULD BE IN REAL TROUBLE, with a capital 'T'!

DO NOT BLAME ME.
YOU HAVE BEEN **STRONGLY**, AND **REPEATEDLY** WARNED!
USE ENTIRELY AT YOUR OWN RISK!

Preamble

Back in the windows 3.1, and for a long time there after, one of the powerful tools shipped with windows was xdel.exe! Then it stopped being included, I guess because you can now do the same 'function' using (a) the built-in 'del', with lots of enhanced abilities, or (b) in the GUI windows explorer. These are the recommended ways. Especially via the GUI windows explorer, since the files are NOT immediately delete, but MOVED to the 'trash'.

Of course I could keep copying the old, circa 1988, runtime to my new world, but then came the changes in the support for 16-bit programs. While they still run, they seem to cause problems, in that the folder, directory, file names, fall back to the old DOS 8.3 convention of names ...

For example, after running it, the old 1988 16-bit xdel program, my '$P$G' command prompt changes from the normal :-
C:\Documents and Settings\Geoff McLane\My Documents\Compaq\MDOS>
to the very UGLY -
C:\DOCUME~1\GEOFFM~1\MYDOCU~1\Compaq\MDOS>

Now while this is not particularly a BIG problem - I could just close it, and open another, for example, but because I can, and  love coding, I still decided to write my own? And that is what this is ... Of course, I add a few very special features of my own, like -c (clean) which 'cleans up' MSVC project build components, and -p (FrontPage) which removes FrontPage 2002+ hidden folders ...

WARNING Watch out, it is POWERFUL! WARNING

After a few mishaps with it, I added a 'continue' prompt, twice, which forces 'y' or 'n'! And added a 'warning' of the number of file, folders, and amount of data to be deleted ... it always required you to add -d, to signal 'do-the-action' ...

BE WARNED! You can really do serious damage to your file system with this tool. You MUST be very sure what you are deleting, is (a) what you want, and (b) is not essential for the running of your OS ...

It can be blocked by files marked with the 'Read Only' attribute, but it has a -m (modify) switch that signals it to try to change the attributes before deleting ... it can still fail if any file or folder is 'owned' by another process, and that can just mean another command prompt is presently in that directory, or some editor has one of the files loaded ...

But, in general, it does a good fast job ;=))

top


Updates

2010-05-22: version 1.0.8 : Added *.bsc to the -c (msvc clean list)

top


Downloads! - BIG WARNING

BIG WARNING: IT CAN NOT BE REPEATED ENOUGH!

MASS DELETING OF FILES FROM YOUR DRIVES CAN KILL YOUR OPERATING SYSTEM, OR DELETE VERY IMPORTANT FILES, PUTTING YOU IN DEEP TROUBLE.

BE VERY SURE YOU KNOW WHAT YOU ARE DOING! ONE SLIP AND YOU COULD BE IN REAL TROUBLE, with a capital 'T'!

DO NOT BLAME ME.
YOU HAVE BEEN **STRONGLY**, AND **REPEATEDLY** WARNED!
USE ENTIRELY AT YOUR OWN RISK!

Some downloads ... as usual, take care downloading and running things from the web. It is highly recommended that you download the source, and compile it yourself. Microsoft offers an 'Express Edition' for free, of their C/C++ IDE tools ...

UPDATE: 20140218: The latest source in now in my repository for all utility apps
https://gitorious.org/fgtools/gtools/source/
and will no longer generally supply pre-built binaries.

Older Sources:

Downloadable source and binaries for WIN32
Date File Size Notes Digest
2010/05/22 xdeletee08.zip 60,812 Binary e516a1c0e30a0e2ac4ba3604f5f0f4d2
2010/05/22 xdelete-08.zip 35,515 Source 99a7fe66be8b109f8eaf94394eeb265c
Older version
2009-04-11 xdeletee07.zip 60,693 Runtime 98c93354c4f92dabde821ac76428df9a
2009-04-11 xdelete-07.zip 35,378 Source 7a79b7fb559a4502e94b60d55a08af16
July, 2008 xdeletee05.zip 59,291 Runtime 7a9551bcb70075ed2ba8fd4259854986
July, 2008 xdelete-05.zip 34,379 Source fbebe216770c254af903ab2e217dcc66

top


Help

This is the output when you add a -? command ...

xdelete - version 1.0.8, of May 22 2010, 16:41:44
Usage: [switches] <directory>
Switches:
   -?    this brief help.
   -c    Clean MSVC build files. (Default=Off)
   -d    Toggle do actual delete (Default=Off)
   -f    Toggle folder delete. (Default=Off)
   -l    Toggle log file, templog.txt. (Default=Off)
   -m    Toggle modify to READ/WRITE to allow delete. (Default=Off)
   -p    Toggle special FrontPage folder delete. (Default=Off)
   -r    Toggle recursive into folders. (Default=Off)
   -s    Toggle save to recyle bin, if possible. (Default=Off)
   -v[n] Set verbosity level - range 0 - 9. (Default=1)
   -dir=<dir> Alternate entry of directory name.
The -c [CLEAN] option will delete all files matching the following :-
*.old *.bak *.obj *.err *.pdb *.lst *.pch *.ilk *.ncb *.plg *.opt *.idb *.aps *.sbr *.suo
*.manifest *.res *.user *.bsc mt.dep BuildLog.htm
The -p [FrontPage] option will delete all the following folders ...
_derived _private _vti_cnf _vti_pvt  usually hidden!
Special NOT RECOMMENDED switch, which is self descriptive!
   -NO-confirmation-please[=nn] : It is long and case sensitive, to remind of the DANGER!
But even with this switch, the program watches the keyboard for 10 seconds, before proceeding.
Unless the timeout(x2) is over-ridden with a number of seconds value nn!

Have fun ...

top


Alternatives

There is a source and runtime at http://sourceforge.net/projects/xdel/ ... no CVS source, but there is a source zip - xdel.source.1.0.zip ... it was written in C# ... having the Express Edition of MS C# available, I recompiled the program from source, and added some, well LOTS really, of my own changes, to give it a try. It has a concept of deleting files in a directory, or deleting the directory itself, but not BOTH! But deleting a directory does delete all the files and other directories within it, so maybe this is ok ...

It bases its search on a 'creation' or 'modification' time of the directory or file ... This looks like an interesting addition I could add to my xdelete, that is, a delete based on a date/time given ... but I would need a strong DateTime parser ... which is easily available in C#, and C++, but my xdelete is presently C only ...

Also this C# programs did not function with READ-ONLY files ... in fact, trying to delete a file, and that includes a file in a directory being deleted, with such a READ-ONLY attribute yielded an 'Unhandled Exception', which aborted the program, like :-

Unhandled Exception: System.UnauthorizedAccessException: Access to the path 
'C:\Projects\xdel\xdel\temp\temp2\file21' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.Delete(String path)
   at xdel.App.Main(String[] args)

It would need stronger or different exception handlers added - it presently does use try { } catch { }, but this seems to fail to even politely 'ignore' this attempt at deletion ... or at least a check of the files attributes, prior to trying to physically delete it, which is what I did ... but later added a -force option, and added the code -

if (cref.is_ro && force_option)
{
   FileAttributes fa = File.GetAttributes(file.FullName);
   fa &= ~(FileAttributes.ReadOnly);
   File.SetAttributes(file.FullName, fa);
   System.IO.File.Delete(file.FullName);
   Write("... Deleted");
   AddToDelTotal(cref);
}

And this seemed to work. If you really want to try this program, then -

xdel.source.1.1.zip  MD5: 357e76d9f71911d8a4f54ef7dae5dfd8

contains both -
(a) a zip of the full source, in xdel-02.zip, which you can re-compile in MSV#8, or later, and
(b) an xdel.exe binary, in xdele02.zip, for testing and trying.

However, this program, written by John Lauer, bugs and comments to: jlauer .-at-. simplewire .-dot-. com, an email address not checked, seems to have had nothing done since around 2004, so maybe he is no longer interested ;=((

But with the very EXTENSIVE modification I have done, it now seems a very viable alternative to my xdelete, with a TIME parameter added ;=))

I have also compiled it using Microsoft Visual C# 2008 Express Edition, (MSV#9), with no problems from my xdel-02.zip source ...

BIG WARNING

BIG WARNING: IT CAN NOT BE REPEATED ENOUGH!

MASS DELETING OF FILES FROM YOUR DRIVES CAN KILL YOUR OPERATING SYSTEM, OR DELETE VERY IMPORTANT FILES, PUTTING YOU IN DEEP TROUBLE.

BE VERY SURE YOU KNOW WHAT YOU ARE DOING! ONE SLIP AND YOU COULD BE IN REAL TROUBLE, with a capital 'T'!

DO NOT BLAME ME. YOU HAVE BEEN **STRONGLY**, AND **REPEATEDLY** WARNED! USE ENTIRELY AT YOUR OWN RISK!

top


checked by Tidy  Valid XHTML 1.0 Transitional