title: Strange Windows DIR command behavior
body: <p>I discovered this quite by accident while looking for a file with a number in the name.  When I type:</p>
  
  <p><b><code>dir</code></b> <code>*</code><em>number</em><code>*</code></p>
  
  <p>(where number represents any number from 0 to 9 and with no spaces between the asterisks and the number)</p>
  
  <p>at the cmd.exe command prompt, it returns various files do not appear in any to fit the search criteria.  What's weird, is that depending on the directory, some numbers will work and not others.  An example is, in a directory associated with a website, I type the following:</p>
  
  <pre><code>dir *4*
  </code></pre>
  
  <p>and what is returned is:</p>
  
  <pre>
  Directory of C:\Ampps\www\includes\pages 
  
  04/30/2012  03:55 PM               153 inventory_list_retrieve.php
  06/18/2012  11:17 AM             6,756 ix.html
  06/19/2012  01:47 PM           257,501 jquery.1.7.1.js
                 3 File(s)        264,410 bytes
                 0 Dir(s)  362,280,906,752 bytes free
  </pre>
  
  <p>That just doesn't make any sense to me.  Any clue?</p>
  
  <p>The question is posed on stackOverflow because the DIR command is often combined with FOR in batch programs. The strange DIR behavior would seem to make batch programs potentially unreliable if they use the DIR command.</p>
  
  <p>Edit: (additional note). Though much time has passed, I discovered another quirk with this that almost cost me a lot of work.  I wanted to delete all <code>.htm</code> files in a particular directory tree.  I realized just before doing it that <code>*.htm</code> matches <code>.html</code> files as well.  Also, <code>*.man</code> matches <code>.manifest</code>, and there are probably others.  Deleting all <code>.html</code> files in that particular directory would have been upsetting to say the least.</p>