Jump to content

Strange Behavior


Martin Zugec

Recommended Posts

Found interesting error...

Open command line (Start - Run - cmd.exe & enter)

Now create two files - test.txt and test.txt2

echo. > test.txt
echo. > test.txt2

Next use command

del *.txt

It should delete only test.txt file, but instead it deleted both of them...

I found this behavior on many XP machines, mine (5.1.2600.2149) is working as expected (but newer version 5.1.2600.2180 is acting bad way, too)...

How is it working on your PCs?

EDIT: I forgot, same problem with dir command, e.g.

dir *.txt

Link to comment
Share on other sites


It has to do with the way that Windows handles wildcards. I think that it reads the command:

del *.txt

as to delete anything that contains the string ".txt" in it, thereby including test.txt2.

I'm not quite sure as to why the newer version would do this... I can imagine that it might screw up some people's programs...

Link to comment
Share on other sites

Is it not that in DOS prompt some commands just read the first 3 characters of extension, just ignoring any more trailing characters?

On win 2k it happens the same.

Probably the DIR and DEL commands, when used with wildcard use the "Short" 8.3 DOS filename for the file.

You can try to use the fsutil behavior set:

http://www.microsoft.com/resources/documen...kc_fil_gtzp.asp

in XP and see if it behaves the same.

jaclaz

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...