Hi
I have to write a batch command to display 7 character long text files on the whole C: Drive with the listing output in wide format.
How do i display 7 character long files?
I have used
DIR C:\ /S /W ???????.TXT
but this doesn't work. What do i use?
Thanks in advance.
Displaying Seven Character Long Text Files
Moderator: DosItHelp
-
- Expert
- Posts: 80
- Joined: 04 Feb 2009 10:03
Something to try ... this implies that you don't care what the extension of the file is.
Code: Select all
@echo off
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION
CD \
For /F "Delims=" %%F In ('Dir /B/S') Do (
Set "f=%%~nxF"
Set "p=%%~pF"
Set "Dot=!f:~7,1!"
If /I [!Dot!] equ [.] (
Echo File is 7 bytes: !f!
Echo File is located: !p!
)
)