I wanted to list files for specified Owner and specified Extension.

DIR D:\Folder /S /Q|FIND /i "OWNER" | findstr /m /i "\.mkv$" >> D:\Folder\list.txt

I tried this, its working but its printing the owner name, date,size. All I want the file list. And I couldn't find a way around this. How can I do that?

有帮助吗?

解决方案

Try this:

@echo off
setlocal

set "s=DIR D:\Folder /S /Q^|FIND /i "OWNER" ^|findstr /m /i "\.mkv$""
for /f "Tokens=5,6*" %%a in ('%s%') do >>D:\Folder\list.txt echo %%a %%b %%c
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top