Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. I question Microsoft's documentation

I question Microsoft's documentation

Scheduled Pinned Locked Moved The Weird and The Wonderful
questioncomsysadmin
4 Posts 3 Posters 40 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Online
    P Online
    PIEBALDconsult
    wrote on last edited by
    #1

    Microsoft wrote:

    You can use wildcard characters (* or ?), to represent one or more characters of a file name and to display a subset of files or subdirectories. The asterisk wildcard always uses short file name mapping, so you might get unexpected results. You can use the question mark (?) as a substitute for a single character in a name.

    -- dir | Microsoft Learn[^] The question mark does not actually substitute for a dot/period/full stop (.) in a file name.

    C:\Users\PIEBALD\AppData\Roaming>copy con foo_bar.txt
    ^Z
    1 file(s) copied.

    C:\Users\PIEBALD\AppData\Roaming>copy con foo.bar.txt
    ^Z
    1 file(s) copied.

    C:\Users\PIEBALD\AppData\Roaming>dir foo*bar.txt
    Volume in drive C is Windows8_OS
    Volume Serial Number is 528E-277C

    Directory of C:\Users\PIEBALD\AppData\Roaming

    2023-03-31 08:06 0 foo.bar.txt
    2023-03-31 08:06 0 foo_bar.txt
    2 File(s) 0 bytes
    0 Dir(s) 28,516,610,048 bytes free

    C:\Users\PIEBALD\AppData\Roaming>dir foo?bar.txt
    Volume in drive C is Windows8_OS
    Volume Serial Number is 528E-277C

    Directory of C:\Users\PIEBALD\AppData\Roaming

    2023-03-31 08:06 0 foo_bar.txt
    1 File(s) 0 bytes
    0 Dir(s) 28,516,675,584 bytes free

    C:\Users\PIEBALD\AppData\Roaming>del foo*bar.txt

    C:\Users\PIEBALD\AppData\Roaming>

    As a further note, I have 8dot3 naming turned off on my personal system and I'll have to try this there. Tested on Win10 as well as this old Win8 junker.

    R G 2 Replies Last reply
    0
    • P PIEBALDconsult

      Microsoft wrote:

      You can use wildcard characters (* or ?), to represent one or more characters of a file name and to display a subset of files or subdirectories. The asterisk wildcard always uses short file name mapping, so you might get unexpected results. You can use the question mark (?) as a substitute for a single character in a name.

      -- dir | Microsoft Learn[^] The question mark does not actually substitute for a dot/period/full stop (.) in a file name.

      C:\Users\PIEBALD\AppData\Roaming>copy con foo_bar.txt
      ^Z
      1 file(s) copied.

      C:\Users\PIEBALD\AppData\Roaming>copy con foo.bar.txt
      ^Z
      1 file(s) copied.

      C:\Users\PIEBALD\AppData\Roaming>dir foo*bar.txt
      Volume in drive C is Windows8_OS
      Volume Serial Number is 528E-277C

      Directory of C:\Users\PIEBALD\AppData\Roaming

      2023-03-31 08:06 0 foo.bar.txt
      2023-03-31 08:06 0 foo_bar.txt
      2 File(s) 0 bytes
      0 Dir(s) 28,516,610,048 bytes free

      C:\Users\PIEBALD\AppData\Roaming>dir foo?bar.txt
      Volume in drive C is Windows8_OS
      Volume Serial Number is 528E-277C

      Directory of C:\Users\PIEBALD\AppData\Roaming

      2023-03-31 08:06 0 foo_bar.txt
      1 File(s) 0 bytes
      0 Dir(s) 28,516,675,584 bytes free

      C:\Users\PIEBALD\AppData\Roaming>del foo*bar.txt

      C:\Users\PIEBALD\AppData\Roaming>

      As a further note, I have 8dot3 naming turned off on my personal system and I'll have to try this there. Tested on Win10 as well as this old Win8 junker.

      R Offline
      R Offline
      RainHat
      wrote on last edited by
      #2

      To be fair, they do warn you that the * uses the 8.3 filename. I guess the ? does as well. Use dir /X to get the 8.3 filenames.

      P 1 Reply Last reply
      0
      • R RainHat

        To be fair, they do warn you that the * uses the 8.3 filename. I guess the ? does as well. Use dir /X to get the 8.3 filenames.

        P Online
        P Online
        PIEBALDconsult
        wrote on last edited by
        #3

        Yet the 8dot3 names don't seem to make a difference -- it behaves the same whether 8dot3 names are enabled on the volume or not. Or maybe it generates 8dot3 names on-the-fly as needed but doesn't store them?

        1 Reply Last reply
        0
        • P PIEBALDconsult

          Microsoft wrote:

          You can use wildcard characters (* or ?), to represent one or more characters of a file name and to display a subset of files or subdirectories. The asterisk wildcard always uses short file name mapping, so you might get unexpected results. You can use the question mark (?) as a substitute for a single character in a name.

          -- dir | Microsoft Learn[^] The question mark does not actually substitute for a dot/period/full stop (.) in a file name.

          C:\Users\PIEBALD\AppData\Roaming>copy con foo_bar.txt
          ^Z
          1 file(s) copied.

          C:\Users\PIEBALD\AppData\Roaming>copy con foo.bar.txt
          ^Z
          1 file(s) copied.

          C:\Users\PIEBALD\AppData\Roaming>dir foo*bar.txt
          Volume in drive C is Windows8_OS
          Volume Serial Number is 528E-277C

          Directory of C:\Users\PIEBALD\AppData\Roaming

          2023-03-31 08:06 0 foo.bar.txt
          2023-03-31 08:06 0 foo_bar.txt
          2 File(s) 0 bytes
          0 Dir(s) 28,516,610,048 bytes free

          C:\Users\PIEBALD\AppData\Roaming>dir foo?bar.txt
          Volume in drive C is Windows8_OS
          Volume Serial Number is 528E-277C

          Directory of C:\Users\PIEBALD\AppData\Roaming

          2023-03-31 08:06 0 foo_bar.txt
          1 File(s) 0 bytes
          0 Dir(s) 28,516,675,584 bytes free

          C:\Users\PIEBALD\AppData\Roaming>del foo*bar.txt

          C:\Users\PIEBALD\AppData\Roaming>

          As a further note, I have 8dot3 naming turned off on my personal system and I'll have to try this there. Tested on Win10 as well as this old Win8 junker.

          G Offline
          G Offline
          Gary R Wheeler
          wrote on last edited by
          #4

          The documentation you cite was proofread poorly. They refer to "dir t97\*" several times rather than "dir t97.*".

          Software Zen: delete this;

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups