batch-file Escaping special characters FOR /F 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 Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

FOR /F

In a FOR /F statement, some characters needs escaping, here a list(taken and edited from Rob van der Woude's page)

CharacterEscaped ResultRemarks
'^'Only needed in FOR /F's brackets, unless usebackq is specified.
`^`Only needed in FOR /F's brackets, when usebackq is specified
,^,
;^;
=^=┣ Must be escaped in FOR /F's brackets, even if it is double-quoted
(^(
)^)


Got any batch-file Question?