Wildcard question

May 20, 2008
11,400
99
Syracuse, NY, USA
Below, should doggy.txt have been deleted?
Code:
v:\> del doggy.txt.*
Deleting V:\doggy.txt
Deleting V:\doggy.txt.aa
Deleting V:\doggy.txt.ab
    3 files deleted
 
v:\> del doggy.txt.?*
Deleting V:\doggy.txt
Deleting V:\doggy.txt.aa
Deleting V:\doggy.txt.ab
    3 files deleted
 
v:\> del doggy.txt.??
Deleting V:\doggy.txt
Deleting V:\doggy.txt.aa
Deleting V:\doggy.txt.ab
    3 files deleted
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,461
88
Albuquerque, NM
prospero.unm.edu
Below, should doggy.txt have been deleted?
Code:
v:\> del doggy.txt.*
Deleting V:\doggy.txt
Deleting V:\doggy.txt.aa
Deleting V:\doggy.txt.ab
    3 files deleted
 
v:\> del doggy.txt.?*
Deleting V:\doggy.txt
Deleting V:\doggy.txt.aa
Deleting V:\doggy.txt.ab
    3 files deleted
 
v:\> del doggy.txt.??
Deleting V:\doggy.txt
Deleting V:\doggy.txt.aa
Deleting V:\doggy.txt.ab
    3 files deleted


Have you tried this?

Code:
DEL DOGGY.TXT.[?]*
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,461
88
Albuquerque, NM
prospero.unm.edu
Or, probably more appropriate to what you're trying to do:

Code:
del doggy.txt[.]*

The [.] only matches an actual period character. (I presume TCC's somewhat surprising behavior is meant to accommodate the die-hard DOSheads who continue to use *.* to mean "all files"....)
 
May 20, 2008
11,400
99
Syracuse, NY, USA
Have you tried this?

Code:
DEL DOGGY.TXT.[?]*
Yes, and that works. I had to write a little program to remind myself how the Win32 FindFirstFile/FindNextFile functions worked. Indeed, according to them, "doggy.txt" matches "doggy.txt.??".
 

rconn

Administrator
Staff member
May 14, 2008
12,345
150
Below, should doggy.txt have been deleted?

Yes -- try it in CMD, and see the same results.

If you don't want the Windows "match one or more characters unless at the end of the name or extension, in which case also match 0 characters" behavior, use regular expressions instead. They tend to be much more predictable!
 
Similar threads
Thread starter Title Forum Replies Date
D Directory History Window with wildcard search Support 3
rps Documentation ? wildcard Support 3
M How to? PDir on multiple wildcard patterns... Support 2
jbarnes1967 Disable wildcard [ char in destination Support 10
C Wildcard expansion in FOR set Support 27
N Directory wildcard failure? Support 1
Stefano Piccardi char class wildcard issue when [] in path Support 14
C forum Posting Question... Support 3
C question re: Move Support 3
S How to? Upgrade Question: What supporting documentation is required at time of purchase? Support 2
Peter Murschall Documentation Question to %@PSHELL Support 4
Fross Tab Question Support 6
Fross Quick Function Question Support 17
Dick Johnson Question about the Touch command Support 0
rps Documentation "Copy+Paste+run" question Support 2
vefatica SFTP question Support 17
vefatica Question about IPWorks Support 0
C How to? SHORTCUT question..... Support 6
vefatica TPIPE, crash and question Support 1
C Question / Suggestion Support 1
MickeyF Another TPIPE question Support 6
vefatica Another @EVERYTHING question Support 4
mikea How to? %@everything[] question Support 10
A License Question for Single User Support 5
Jay Sage Help Correction (and Related Question) Support 0
S Elapsed time in TCC prompt question Support 0
H command line parsing question Support 5
C Forum question Support 2
B Newbie here, I have a question. Support 4
J Dumb Question ... Support 4
Timothy Byrd Updating from TC 9 to TC 17 - TCTOOLBAR question Support 2
M A possibly stupid question about the "del" command... Support 7
M A just out of curiosity question re @DiskTotal Support 4
Fross Status Bar Time Question Support 1
A Stupid, obvious question - launch a BAT with TC Support 10
C How to? GLOBAL question Support 5
vefatica OT: VisualStudio question Support 1
Dan Glynhampton v15 installer question Support 2
C Move question with Encrypted file... Support 6
M Maybe Maybe I'm being stupid (again), but a simple question... Support 4
C Message Board question Support 1
James Miller How to? filename completion question Support 1
C coding question Support 3
M A just-out-of-curiosity question because it's ... Support 6
Frank question to FOLDERMONITOR Support 14
C Dumb titleprompt question Support 4
M Upgrade Question Support 2
S option /u question Support 19
M How to? A probably stupid question re "@Files" and Include Lists... Support 2
M Just an out-of-curiosity question re. "Do ... /P ..." Support 31

Similar threads