Martin Zugec Posted March 8, 2005 Posted March 8, 2005 Found interesting error... Open command line (Start - Run - cmd.exe & enter)Now create two files - test.txt and test.txt2echo. > test.txtecho. > 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
Cartoonite Posted March 8, 2005 Posted March 8, 2005 You're right soulin, that is strange and interesting. My PC behaves in the same way, dir *.txt listed both files.
Zxian Posted March 8, 2005 Posted March 8, 2005 It has to do with the way that Windows handles wildcards. I think that it reads the command:del *.txtas 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...
Martin Zugec Posted March 8, 2005 Author Posted March 8, 2005 Well, in that case U should use txt? or txt*... This is really strange, practical problem is for example htm vs. html
jaclaz Posted March 8, 2005 Posted March 8, 2005 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.aspin XP and see if it behaves the same.jaclaz
Martin Zugec Posted March 9, 2005 Author Posted March 9, 2005 I already thought this way... but it didnt help (for me). Am I the only person where it is working as it should?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now