Create Text Document with CMD

Sergio Ibarra 21 Reputation points
2022-10-20T00:31:06.457+00:00

Hello, I have a batch file with several functions, one generates a TXT file with text inside. The problem is that one of the lines contains the word "MODE" and when executing the function, instead of writing the word, it executes the command.

I leave the code of the function with problems.

echo LANGUAGE=es>TEST.TXT
echo AUTOUPDATE=False>>TEST.TXT
echo TRACK_ID=>>TEST.TXT
echo FOLDER=%~dp0>>TEST.TXT
echo MainSplitterPos=620>>TEST.TXT
echo FORMAT=False>>TEST.TXT
echo MODE=0>>TEST.TXT <-line in conflict
echo BATCH_ART_SHARE_IGNORED_GAMES=>>TEST.TXT

thanks...

0 comments No comments
{count} votes

Accepted answer
  1. Dillon Silzer 57,491 Reputation points
    2022-10-20T02:45:04.023+00:00

    Hi @Sergio Ibarra

    Try the following:

    echo MODE=^0>>TEST.TXT

    The ^ is an escape character.

    -------------------------

    If this is helpful please accept answer.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.