Batch: How to find and get file name -
i'm trying find files contains string
, print file names , without extension.
very important, files located sub-folders
of main folder
, know path of main folder
.
this returns 'full path' , extension of files containing word string
:
findstr /s /m "string" c:main folder\*.txt >list.txt
desired output: only file name
cheers, andy
@echo off setlocal /f "delims=" %%a in ('findstr /s /m /i "string" "c:main folder\*.txt" ') ( echo full %%a echo name %%~na echo nameext %%~nxa ) goto :eof
i added /i
case-insensitivity.
choose filename version want , redirect @ will.
Comments
Post a Comment