dir ????????.txt does not show only files with length of 8 characters
Posted: 17 May 2024 04:22
How to list only files with filenames of 8-characters in length?
Output:
See also viewtopic.php?f=3&t=6207 and viewtopic.php?f=3&t=5057
Tried different options with < and >. No luck.
My filenames are actually numbers only so maybe regex could help (dir /b *.txt|findstr ...).
Thanks.
Saso
Code: Select all
@echo off
break>12345678.txt
break>87654321.txt
break>test.txt
break>123456789.txt
echo dir ????????.txt
dir ????????.txt
echo --------------
echo dir "????????.>txt"
dir "????????.>txt"
echo --------------
Code: Select all
dir ????????.txt
17.05.2024 12:19 0 12345678.txt
17.05.2024 12:19 0 123456789.txt
17.05.2024 12:19 0 87654321.txt
17.05.2024 12:19 0 test.txt
--------------
dir "????????.>txt"
Directory of c:\temp
File Not Found
--------------
c:\temp>
Tried different options with < and >. No luck.
My filenames are actually numbers only so maybe regex could help (dir /b *.txt|findstr ...).
Thanks.
Saso