0

I want the code below to work or something that does the same thing.

@echo off
echo 100%
pause

When you open the .bat file it shuld look like this.

100%
Press any key to continue . . .

So i want the echo to read out the % and not to be a part of a code.

I want it to work the same as for example

@echo off
echo hi
pause

I have only tried echo 100% because i am a noob at coding so i dont know what else to try.

ling0nriz
  • 5
  • 5
  • 1
    Your question has been asked and answered multiple times before. There's no reason why using the search facility at the top of the page, with `[batch-file]` and search terms like `echo`, `escape` and `percent` would not have gotten you your answer. You should also familiarize yourself with [this question, and answers](https://stackoverflow.com/q/4094699), which should cover most things you'll struggle with, (including the solution for this question). – Compo Feb 14 '23 at 13:13
  • i did not find any – ling0nriz Feb 14 '23 at 14:12

1 Answers1

1

The percent sign has special meaning in (Windows) batch files, it is used to indicate a variable. For instance, echo %username% will print the contents of the username variable.

To echo a literal % sign, you need to double it, i.e. echo 100%%

Berend
  • 780
  • 7
  • 19