batch-file Escaping special characters FIND and FINDSTR Special Characters

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

In find and findstr, there are some special characters that require some caution on it.


FIND

There is only one character that needs escaping - " quote. To escape it, simply add another quote next to it. So " becomes "". Pretty simple.


FINDSTR

Findstr comes with plenty of characters to escape, so please be very cautious. Using \, we can escape special characters. Here's a list of special characters to escape

CharacterEscaped Result
\\\
[\[
]\]
"\"
.\.
*\*
?\?


Got any batch-file Question?