Microsoft Delete bug


Windows DELETE bug discovered by Frank Brown, 18-Oct-2002

Deleting files by specifying the filename extension is dangerous, because CMD.EXE's DEL command only parses the first 3 characters of the extension. For example, suppose you have the following files:

test.fil
test.fil2
test.fil9999
test.filRed
test.filGreen

The command "DEL *.FIL" would delete ALL of the files, not just test.fil.

I confirmed this behavior on Win2000 Pro/SP3 and XP Pro/SP1. So watch out!

22-Oct-2002 update:
Mark V replied to my usenet post with the information that this behavior can be turned off by setting the value of registry item Win95TruncatedExtensions to 0 in subkey HKLM\SYSTEM\CurrentControlSet\Control\FileSystem. Yes folks, so it appears this behavior is INTENTIONAL!

Copyright ©2002 by Frank Brown.