Windows Batch Gotcha: Use REM Inside IF Blocks

Normally I comment out lines in a Windows batch script by prefixing them with “::”—it just looks better to me than “REM”. But today I found out the hard way (of course) that you can’t do that inside an IF block, or the script dies with…

The syntax of the command is incorrect.

By Jeff Garretson

Husband, father. Data Engineer. Explorer of Powerful Ideas. Faith and Reason integrated.