-2

I'm echoing out line from a batch file into another file. I know that to escape % you need %% but i can't figure out the escape sequence for %%. The following is what I am trying to accomplish

echo something %%stuff > secondFile.txt

Resulting in

something %%stuff

I have tried the following patterns:

  • %%%%
  • ^%^%
  • %%%
Ethan
  • 1
  • 1
  • 1
    Possible duplicate of [Ignore percent sign in batch file](https://stackoverflow.com/questions/1907057/ignore-percent-sign-in-batch-file) – Sam Denty Jul 07 '17 at 19:01
  • No, you have not tried `%%%%` in a batch file as this would result in `%%` literally; perhaps you tried it in command prompt directly? – aschipfl Jul 08 '17 at 08:12

1 Answers1

1

it's different on command line and in a batchfile.

On commandline: echo some %%stuff
in a batchfile: echo some %%%%stuff

Stephan
  • 53,940
  • 10
  • 58
  • 91