Batch Scripting - Listing files with a specific amount of characters in file name

Posted by Jane on Super User See other posts from Super User or by Jane
Published on 2012-09-04T03:08:07Z Indexed on 2012/09/04 3:40 UTC
Read the original article Hit count: 455

Filed under:
|
|

I'm creating a batch script for a class and I've hit a roadblock

I have to list all text files whose names are up to seven characters long on the whole c: drive - make the listing output in a wide formant - then append to Batch script file output.txt

So far I have -->
dir c:*txt/w/o/s/p >>c:/"My Batch Script File Assigment"/"Output"/"Batch Script File Output Data".txt

The above does everything except limit the search to files with only 1-7 characters in their name.

If anyone could point me in the right direction I would really appreciate it!

© Super User or respective owner

Related posts about command-line

Related posts about script