Page 1 of 1

echo text %% [SOLVED]

Posted: 28 Aug 2018 11:39
by deniscalanca
Hello, I'm building a batch file that will generate a new .cmd file, I need to send it to this new file through echo:

for / l %% w in (1,1,20) do mode with: cols = 67 lines = %% w

more in the new file comes out as follows:

for /l % w in (1,1,20) do mode with: cols = 67 lines = % w

How to send through the echo command %%?

Re: echo text %%

Posted: 28 Aug 2018 11:41
by Squashman
Double the percent symbols.

Code: Select all

echo for /l %%%%w in (1,1,20) do mode con:cols=67 lines=%%%%w>mybat.bat

Re: echo text %%

Posted: 28 Aug 2018 11:51
by deniscalanca
Squashman wrote:
28 Aug 2018 11:41
Double the percent symbols.

Code: Select all

echo for /l %%%%w in (1,1,20) do mode con:cols=67 lines=%%%%w>mybat.bat
Thank you very much.