-1

i wonder if it is possible to echo/print or save two %% character sign in a txt file.

i tried this one

echo FOR /f "delims=" ^%%p IN ('dir /b /s *.info') do ( > D:\Desktop\sample.txt

but the output is this

FOR /f "delims=" %p IN ('dir /b /s *.info') do (

only one modulo sign is being written to my txtfile.

i expected to be like this

FOR /f "delims=" %%p IN ('dir /b /s *.info') do (

i hope it is possible because i want to create a batch file using a batch file too.

Doy Lyster
  • 11
  • 3
  • Does this answer your question? [Ignore percent sign in batch file](https://stackoverflow.com/questions/1907057/ignore-percent-sign-in-batch-file) Specifically, double up each percent sign you want displayed, so `echo FOR /f "delims=" %%%%p IN ('dir /b /s *.info') do ( > D:\Desktop\sample.txt` – SomethingDark Aug 05 '23 at 02:49
  • yes exactly what i need. thank you so much for your help. now i can create a desired batch file using another batch file too. thank you so much.. – Doy Lyster Aug 05 '23 at 03:10
  • 1
    i figured it out before i could read the comment of SomethingDark..but i thank him also because of his comment also confirming me that im right to what i've found out. :D – Doy Lyster Aug 05 '23 at 03:12
  • 1
    another very helpful source when escaping characters using echo in batchfile here: https://stackoverflow.com/questions/6828751/batch-character-escaping – Doy Lyster Aug 06 '23 at 07:35

0 Answers0