I have a for loop that gives me access to filenames in a folder, and I need to check that filename to see if it contains a string.
For example, filename: 'C:\Temp\hello.cs' Pattern to find: 'C:\Temp\h'
The pseudocode for this is
IF filename.Contains(pattern) then
// DO SOMETHING
END IF
I tried this:
%%i|find %pattern% >nul
if not errorlevel 1 echo "Pattern matched"
But it just opened the file as if I'd double-clicked on the file.
echo %%i|find...