Reputation: 165
I would like to list only XML files from the folder "C:\Test\Path" and save the results to a text file.
However, the following command lists all files from the folder and not only the XML files:
cmd /c dir "C:\Test\Path" /s /b *.xml> c:\Test\RunDIROnXMLFolder11.txt
Upvotes: 1
Views: 1807
Reputation: 56180
the proper syntax is:
cmd /c dir /s /b "C:\Test\Path\*.xml" > c:\Test\RunDIROnXMLFolder11.txt
(/s
and /b
may be before or after the filespecification, but this should be
<drive>:\<path>\<filespec>
Upvotes: 1
Reputation: 1562
Try ..
cmd /c dir /s /B "C:\Test\Path\*.xml" > c:\Test\RunDIROnXMLFolder11.txt
Upvotes: 0