Ricky Barnett
Ricky Barnett

Reputation: 1170

Batch - Printing Echo is OFF

I have the following code:

@ECHO OFF
FOR /F "tokens=*" %%A IN (%ThisService_WorkingDirectory%MPMissions\%ThisService_mapname%\init.sqf) DO (
  ECHO %%A
  IF "%%A" EQU "DZE_BuildOnRoads = false; // Default: False" (
    TYPE D:\god-bases\god-bases.txt
  )
) >> temp.txt
move /y temp.txt %ThisService_WorkingDirectory%MPMissions\%ThisService_mapname%\init.sqf

How do I stop this from printing "Echo is OFF" in blank space?

Upvotes: 2

Views: 399

Answers (1)

jeb
jeb

Reputation: 82267

Change echo %%A to echo(%%A.

This will avoid problems with nearly all possible combinations of %%A like
<empty>, ON or /?

Upvotes: 3

Related Questions