Name: fheartman Date: March 25, 2005 at 08:47:52 Pacific Subject: Dir list of files only,no subfolder OS: Win 2000 pro CPU/Ram: 2.4g 1g
Comment:
Hoe can I get a list of files only that are in a specified directory. I do not want the names of the sub folders displayed. Now I am using dir /b i:\testfolder\ Inside of the test folders are files and sub folders. I only want dir to return the list of files.
The DOS DIR command was not originally designed to do something link that. But in later versions, the ability to do that was added. Quite simple and obvious if you just bother to look at at the DIR command syntax. DIR /?
The exact command depends on what you want.
If you want all files including the hidden files to be listed, but not the folders do:
DIR /a-d
If you only want the files a plain DIR commond would list and not the folders, use:
DIR /a-d-h
Keep in mind, this will not work on the oldest versons of DOS.