Wednesday, October 30, 2013

DOS CMD BATCH echo to findstr problem

DOS CMD BATCH echo to findstr problem


As shown below, echo of a string, without surrounding quotes, generates the error “The system cannot find the file specified” but just adding a quote around each side of the echo’d string solves the problem.


C:\testscripts>echo <--cow | findstr /r "<--.*"
The system cannot find the file specified.

C:\testscripts>echo "<--cow" | findstr /r "<--.*"
"<--cow"


No comments:

Post a Comment