Command prompt and wild cards

  • Thread starter Thread starter Wayne
  • Start date Start date
W

Wayne

I have a need to find all files in a directory where the file name is 11
chars, and the extension is 3 chars ending with an M. I have tried the
following:

dir ???????????.??M /s



Also have tried going from the opposite way, finding all 8.3 files and then
just subtracting from the total count, like so:



dir ????????.??M /s



However it appears that the wild cards operate on the 8.3 formats of the
files as well, so both options return me ALL the files in the directory.
Installing something on the machine or changing the registry is out.



Anyone know of a way to get all the files I need using DIR?
 
Wayne

I think that you will find that the * is the wildcard character (top right
of the number pad..
 
Mike, he is trying to limit to files with exactly 8 characters before the
period and exactly three ending in M after.
 
Colin

I think that he wants 11 characters.. but that is immaterial.. that command
as typed will not run in the RUN box,

If run in Command Prompt brings up all files where the extension ends in M
regardless of how many characters are in the name.. when changed to just one
? or *, the same results are shown..

In Windows Explorer, the command works with one wildcard character before
the .**M or ??M just as it does in CP, but any more than that sends explorer
into a search loop from which the only recovery option is to close the
window..

It has me beat for sure.. any ideas?


--
Mike Hall
MVP - Windows Shell/user







Colin Barnhorst said:
Mike, he is trying to limit to files with exactly 8 characters before the
period and exactly three ending in M after.
 
No. I was just observing why he was trying eight ?s instead of some
combination with *. Perhaps there is a third party search tool that can do
it.

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Mike Hall (MS-MVP) said:
Colin

I think that he wants 11 characters.. but that is immaterial.. that
command as typed will not run in the RUN box,

If run in Command Prompt brings up all files where the extension ends in M
regardless of how many characters are in the name.. when changed to just
one ? or *, the same results are shown..

In Windows Explorer, the command works with one wildcard character before
the .**M or ??M just as it does in CP, but any more than that sends
explorer into a search loop from which the only recovery option is to
close the window..

It has me beat for sure.. any ideas?


--
Mike Hall
MVP - Windows Shell/user







Colin Barnhorst said:
Mike, he is trying to limit to files with exactly 8 characters before the
period and exactly three ending in M after.

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Mike Hall (MS-MVP) said:
Wayne

I think that you will find that the * is the wildcard character (top
right of the number pad..

--
Mike Hall
MVP - Windows Shell/user







I have a need to find all files in a directory where the file name is 11
chars, and the extension is 3 chars ending with an M. I have tried the
following:

dir ???????????.??M /s



Also have tried going from the opposite way, finding all 8.3 files and
then
just subtracting from the total count, like so:



dir ????????.??M /s



However it appears that the wild cards operate on the 8.3 formats of
the
files as well, so both options return me ALL the files in the
directory.
Installing something on the machine or changing the registry is out.



Anyone know of a way to get all the files I need using DIR?
 
Colin

In DOS or the CP, eight characters plus the extension is as good as it gets
anyway.. maybe the OP will return and explain more what he is trying to
achieve and why.. :)

--
Mike Hall
MVP - Windows Shell/user







Colin Barnhorst said:
No. I was just observing why he was trying eight ?s instead of some
combination with *. Perhaps there is a third party search tool that can
do it.

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Mike Hall (MS-MVP) said:
Colin

I think that he wants 11 characters.. but that is immaterial.. that
command as typed will not run in the RUN box,

If run in Command Prompt brings up all files where the extension ends in
M regardless of how many characters are in the name.. when changed to
just one ? or *, the same results are shown..

In Windows Explorer, the command works with one wildcard character before
the .**M or ??M just as it does in CP, but any more than that sends
explorer into a search loop from which the only recovery option is to
close the window..

It has me beat for sure.. any ideas?


--
Mike Hall
MVP - Windows Shell/user







Colin Barnhorst said:
Mike, he is trying to limit to files with exactly 8 characters before
the period and exactly three ending in M after.

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Wayne

I think that you will find that the * is the wildcard character (top
right of the number pad..

--
Mike Hall
MVP - Windows Shell/user







I have a need to find all files in a directory where the file name is
11
chars, and the extension is 3 chars ending with an M. I have tried the
following:

dir ???????????.??M /s



Also have tried going from the opposite way, finding all 8.3 files and
then
just subtracting from the total count, like so:



dir ????????.??M /s



However it appears that the wild cards operate on the 8.3 formats of
the
files as well, so both options return me ALL the files in the
directory.
Installing something on the machine or changing the registry is out.



Anyone know of a way to get all the files I need using DIR?
 
I didn't mean to get into it anyway. Sorry about that. :)

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Mike Hall (MS-MVP) said:
Colin

In DOS or the CP, eight characters plus the extension is as good as it
gets anyway.. maybe the OP will return and explain more what he is trying
to achieve and why.. :)

--
Mike Hall
MVP - Windows Shell/user







Colin Barnhorst said:
No. I was just observing why he was trying eight ?s instead of some
combination with *. Perhaps there is a third party search tool that can
do it.

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Mike Hall (MS-MVP) said:
Colin

I think that he wants 11 characters.. but that is immaterial.. that
command as typed will not run in the RUN box,

If run in Command Prompt brings up all files where the extension ends in
M regardless of how many characters are in the name.. when changed to
just one ? or *, the same results are shown..

In Windows Explorer, the command works with one wildcard character
before the .**M or ??M just as it does in CP, but any more than that
sends explorer into a search loop from which the only recovery option is
to close the window..

It has me beat for sure.. any ideas?


--
Mike Hall
MVP - Windows Shell/user







Mike, he is trying to limit to files with exactly 8 characters before
the period and exactly three ending in M after.

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Wayne

I think that you will find that the * is the wildcard character (top
right of the number pad..

--
Mike Hall
MVP - Windows Shell/user







I have a need to find all files in a directory where the file name is
11
chars, and the extension is 3 chars ending with an M. I have tried
the
following:

dir ???????????.??M /s



Also have tried going from the opposite way, finding all 8.3 files
and then
just subtracting from the total count, like so:



dir ????????.??M /s



However it appears that the wild cards operate on the 8.3 formats of
the
files as well, so both options return me ALL the files in the
directory.
Installing something on the machine or changing the registry is out.



Anyone know of a way to get all the files I need using DIR?
 
Colin

You can't desert a sinking ship so easily.. move over.. we'll take an oar
each.. :)

--
Mike Hall
MVP - Windows Shell/user







Colin Barnhorst said:
I didn't mean to get into it anyway. Sorry about that. :)

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Mike Hall (MS-MVP) said:
Colin

In DOS or the CP, eight characters plus the extension is as good as it
gets anyway.. maybe the OP will return and explain more what he is trying
to achieve and why.. :)

--
Mike Hall
MVP - Windows Shell/user







Colin Barnhorst said:
No. I was just observing why he was trying eight ?s instead of some
combination with *. Perhaps there is a third party search tool that can
do it.

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Colin

I think that he wants 11 characters.. but that is immaterial.. that
command as typed will not run in the RUN box,

If run in Command Prompt brings up all files where the extension ends
in M regardless of how many characters are in the name.. when changed
to just one ? or *, the same results are shown..

In Windows Explorer, the command works with one wildcard character
before the .**M or ??M just as it does in CP, but any more than that
sends explorer into a search loop from which the only recovery option
is to close the window..

It has me beat for sure.. any ideas?


--
Mike Hall
MVP - Windows Shell/user







Mike, he is trying to limit to files with exactly 8 characters before
the period and exactly three ending in M after.

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Wayne

I think that you will find that the * is the wildcard character
(top right of the number pad..

--
Mike Hall
MVP - Windows Shell/user







I have a need to find all files in a directory where the file name is
11
chars, and the extension is 3 chars ending with an M. I have tried
the
following:

dir ???????????.??M /s



Also have tried going from the opposite way, finding all 8.3 files
and then
just subtracting from the total count, like so:



dir ????????.??M /s



However it appears that the wild cards operate on the 8.3 formats of
the
files as well, so both options return me ALL the files in the
directory.
Installing something on the machine or changing the registry is out.



Anyone know of a way to get all the files I need using DIR?
 
Splash....splash....splash....... <g>

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Mike Hall (MS-MVP) said:
Colin

You can't desert a sinking ship so easily.. move over.. we'll take an oar
each.. :)

--
Mike Hall
MVP - Windows Shell/user







Colin Barnhorst said:
I didn't mean to get into it anyway. Sorry about that. :)

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Mike Hall (MS-MVP) said:
Colin

In DOS or the CP, eight characters plus the extension is as good as it
gets anyway.. maybe the OP will return and explain more what he is
trying to achieve and why.. :)

--
Mike Hall
MVP - Windows Shell/user







No. I was just observing why he was trying eight ?s instead of some
combination with *. Perhaps there is a third party search tool that
can do it.

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Colin

I think that he wants 11 characters.. but that is immaterial.. that
command as typed will not run in the RUN box,

If run in Command Prompt brings up all files where the extension ends
in M regardless of how many characters are in the name.. when changed
to just one ? or *, the same results are shown..

In Windows Explorer, the command works with one wildcard character
before the .**M or ??M just as it does in CP, but any more than that
sends explorer into a search loop from which the only recovery option
is to close the window..

It has me beat for sure.. any ideas?


--
Mike Hall
MVP - Windows Shell/user







Mike, he is trying to limit to files with exactly 8 characters before
the period and exactly three ending in M after.

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Wayne

I think that you will find that the * is the wildcard character
(top right of the number pad..

--
Mike Hall
MVP - Windows Shell/user







I have a need to find all files in a directory where the file name
is 11
chars, and the extension is 3 chars ending with an M. I have tried
the
following:

dir ???????????.??M /s



Also have tried going from the opposite way, finding all 8.3 files
and then
just subtracting from the total count, like so:



dir ????????.??M /s



However it appears that the wild cards operate on the 8.3 formats
of the
files as well, so both options return me ALL the files in the
directory.
Installing something on the machine or changing the registry is
out.



Anyone know of a way to get all the files I need using DIR?
 
In Colin Barnhorst <colinbarharst(nojunk)@msn.com> had this to say:

My reply is at the bottom of your sent message:

I'm not going to get into the boat with you two, there's just something
about three men in a tub that I find disturbing. Anyhow, perhaps a GREP tool
for Windows will suit the OP's needs should they ever return and comment
about it? There's about a billion and three (or more) freeware versions to
pick from. Some even have GUIs with advanced features such as those perhaps?

http://www.google.com/search?num=100&hl=en&lr=&newwindow=1&safe=off&q=grep+for+windows+freeware

Galen
 
What the hay. I'll make it four. :-)

Scripting is about the only way out of the box with command line tools,
although ????????.??m works correctly via explorer search.

Not sure what issue Mike had in explorer but it just located 424 files on my
C: drive perfectly fine.
 
The butcher, the baker, the B-Tree maker.

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Walter Clayton said:
What the hay. I'll make it four. :-)

Scripting is about the only way out of the box with command line tools,
although ????????.??m works correctly via explorer search.

Not sure what issue Mike had in explorer but it just located 424 files on
my C: drive perfectly fine.
 
B-Tree? B-Tree? Yes, SQL would work as expected. ;-)

--
Walter Clayton
Any technology distinguishable from magic is insufficiently advanced.


Colin Barnhorst said:
The butcher, the baker, the B-Tree maker.
 
Walter

I can tell you exactly what problem I had.. having tried the search four
times because the first three didn't appear to work because the ball thingy
in the mouse would only work the pointer up and down, Win Exp went into
spasm and I had to reboot.. if I want to find files, I do a regular search..
I have found thousands on this machine already.. :)

... but are they all necessary, or is it a ploy to get me to buy ever
increasing Gb real estate?.. Colin has so much HDD space available that its
just not funny.. why he hasn't taken the opportunity to reload XP numerous
times has left me stunned..

... and why doesn't MS Backup support backing up 200 Gb of data onto
floppies, and if it did, what happens if floppy # 17344 craps out halfway?..
(lol.. I remember users trying to back up Win 3.1 complete with swap file
onto floppies, and wondering why the back up needed so many more floppies
than the original six that Win 3.1 was installed off)..

... and if you think that it ends here, forget it, because I have some soup
stained 5.25 floppies with GemWrite files on them and MS Word 2003 won't
read them.. I folded them all neatly into sizes that fitted the floppy drive
on the front part which has all but not worked anyway since I put SP2 on,
which I didn't need because somebody told me I didn't..

Oops.. gotta go, guys.. its coffee and medication time.. coming, Nurse
Ratched.. don't panic..

--
Mike Hall
MVP - Windows Shell/user







Walter Clayton said:
What the hay. I'll make it four. :-)

Scripting is about the only way out of the box with command line tools,
although ????????.??m works correctly via explorer search.

Not sure what issue Mike had in explorer but it just located 424 files on
my C: drive perfectly fine.
 
Mike Hall (MS-MVP) said:
Walter

I can tell you exactly what problem I had.. having tried the search four
times because the first three didn't appear to work because the ball
thingy in the mouse would only work the pointer up and down,

You mean it's supposed to move side to side? Wow! I've just been dragging my
monitors side to side (I finally put casters on 'em to make easier since I
was gouging a huge grove in my desk).
Win Exp went into spasm and I had to reboot.. if I want to find files, I
do a regular search.. I have found thousands on this machine already.. :)

Yeah I know. I keep finding them critters all the time too.
.. but are they all necessary, or is it a ploy to get me to buy ever
increasing Gb real estate?.. Colin has so much HDD space available that
its just not funny..

I *am* contemplating buying a TB across 4 drives and hanging 'em in a
RAID0+1 to go with my other 700G. Where has all my free space gone long time
passing, where has all my free space gone, so long ago....
why he hasn't taken the opportunity to reload XP numerous times has left
me stunned..

I do it vicariously via virtual machines. :-)
.. and why doesn't MS Backup support backing up 200 Gb of data onto
floppies,

There's a flavor that does, but are there enough diskettes in the world?
and if it did, what happens if floppy # 17344 craps out halfway?..

You do the paper work, flush and start over.
(lol.. I remember users trying to back up Win 3.1 complete with swap file
onto floppies, and wondering why the back up needed so many more floppies
than the original six that Win 3.1 was installed off)..

It's a conspiracy. That or them bits expanding into bytes. Take your pick.
.. and if you think that it ends here, forget it, because I have some soup
stained 5.25 floppies with GemWrite files on them

GemWrite? GemWrite? Give me WordStar!!
and MS Word 2003 won't read them.. I folded them all neatly into sizes
that fitted the floppy drive on the front part

Oops! You have to put them in the cup holder.
which has all but not worked anyway since I put SP2 on, which I didn't
need because somebody told me I didn't..

Yes, yes, I know, Obsolescence is the first step on the road to Nostalgia.
Oops.. gotta go, guys.. its coffee and medication time.. coming, Nurse
Ratched.. don't panic..

Just wait for the guys with the butterfly nets. They're from the gov'ment
and here to help.
 
I have loaded XP many times. Four of them are running on this computer on
demand. In VPC. btw, my new Hitachi SATA 400GB drive is due Tuesday. :)

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Mike Hall (MS-MVP) said:
Walter

I can tell you exactly what problem I had.. having tried the search four
times because the first three didn't appear to work because the ball
thingy in the mouse would only work the pointer up and down, Win Exp went
into spasm and I had to reboot.. if I want to find files, I do a regular
search.. I have found thousands on this machine already.. :)

.. but are they all necessary, or is it a ploy to get me to buy ever
increasing Gb real estate?.. Colin has so much HDD space available that
its just not funny.. why he hasn't taken the opportunity to reload XP
numerous times has left me stunned..

.. and why doesn't MS Backup support backing up 200 Gb of data onto
floppies, and if it did, what happens if floppy # 17344 craps out
halfway?.. (lol.. I remember users trying to back up Win 3.1 complete with
swap file onto floppies, and wondering why the back up needed so many more
floppies than the original six that Win 3.1 was installed off)..

.. and if you think that it ends here, forget it, because I have some soup
stained 5.25 floppies with GemWrite files on them and MS Word 2003 won't
read them.. I folded them all neatly into sizes that fitted the floppy
drive on the front part which has all but not worked anyway since I put
SP2 on, which I didn't need because somebody told me I didn't..

Oops.. gotta go, guys.. its coffee and medication time.. coming, Nurse
Ratched.. don't panic..

--
Mike Hall
MVP - Windows Shell/user
 
In Mike Hall (MS-MVP) <[email protected]> had this to say:

My reply is at the bottom of your sent message:
.. and if you think that it ends here, forget it, because I have some
soup stained 5.25 floppies with GemWrite files on them and MS Word
2003 won't read them.. I folded them all neatly into sizes that
fitted the floppy drive on the front part which has all but not
worked anyway since I put SP2 on, which I didn't need because
somebody told me I didn't..

I still have working Zork on 5 1/4" drives still. It's for my TRS 80 II...
Greatest game to ever come across my desktop except, maybe, Fallout and
Fallout II...

Galen
 
First thanks for all the replies. I was looking for the 8 instead of 11 as
11 ?'s would include the 8 chars. I didn't want to use explorer as there
were 2.8 million files to search as of a month ago, and the directory
structure was only 6 months old. I find Explorers search craps out if you
have to many files. Installing an application freeware or otherwise requires
WAY to much paperwork thus not making it worth it.

What I finally wound up doing is the following:

dir /s /b > output.txt

then I wrote a small app to parse the output.txt and give me a count of
files that have exactly 11 chars. I did this via a mapped drive to get
around having to write anything to the production machine. (I HATE
PAPERWORK!!!!)

Thanks
Wayne


Mike Hall (MS-MVP) said:
Colin

I think that he wants 11 characters.. but that is immaterial.. that command
as typed will not run in the RUN box,

If run in Command Prompt brings up all files where the extension ends in M
regardless of how many characters are in the name.. when changed to just one
? or *, the same results are shown..

In Windows Explorer, the command works with one wildcard character before
the .**M or ??M just as it does in CP, but any more than that sends explorer
into a search loop from which the only recovery option is to close the
window..

It has me beat for sure.. any ideas?


--
Mike Hall
MVP - Windows Shell/user







Colin Barnhorst said:
Mike, he is trying to limit to files with exactly 8 characters before the
period and exactly three ending in M after.

--
Colin Barnhorst [MVP Windows - Virtual Machine]
(Reply to the group only unless otherwise requested)
Mike Hall (MS-MVP) said:
Wayne

I think that you will find that the * is the wildcard character (top
right of the number pad..

--
Mike Hall
MVP - Windows Shell/user







I have a need to find all files in a directory where the file name is 11
chars, and the extension is 3 chars ending with an M. I have tried the
following:

dir ???????????.??M /s



Also have tried going from the opposite way, finding all 8.3 files and
then
just subtracting from the total count, like so:



dir ????????.??M /s



However it appears that the wild cards operate on the 8.3 formats of the
files as well, so both options return me ALL the files in the directory.
Installing something on the machine or changing the registry is out.



Anyone know of a way to get all the files I need using DIR?
 
Back
Top