What does symbol ^ mean in Batch script?

batch-file, windows

Solution

The caret '^' character serves two purposes in Windows batch files:

1. line continuations:

~~~

@echo off

dir ^
/ad ^
c:\temp

~~~~

results in dir /ad c:\temp, which lists only the directories in C:\temp.

2. Escaping reserved shell characters & | ( < > ^.

Use a preceding caret to escape and print the character:

echo this pipe will print ^| but this one won't |
echo and this will print one caret ^^

Problem

In this command: ``` FOR /F %%A IN ('TYPE "%InFile%"^|find /v /c ""')DO SET "Till=%%A" ``` what does the `^` mean?

Original source