When using:
dir *.doc
all files that have suffixes .docx, .docm, .doct, and .doc files are listed.
When using:
dir *.xls
all files that have suffixes .xlsx, .xlsm, and .xls files are listed.
Is there a way to use the dir command in the command prompt to only list files with the .doc extension? Or only those with the .xls extension? In other words prevent the results from including .docx, .docm, .xlsx, .xlsm, etc...
You could use findstr to identify filenames ending with ".doc" an no other letters.
dir /s /b *.doc | findstr /I /E "\.doc"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With