I am creating a program in DOS code with extension ".bat"
but I have the small problem that I want to show a percentage and for this I need to print the symbol on the screen "%"
.
I have to add that I already tried with "%", '%' and % but none of those three ways worked for me, I would appreciate the help.
It's a bit strange but you need to use
%%
to escape only that sign. For others see this list.If I'm not wrong, in DOS code you could print any symbol with a double percentage, that is,
%así%
.Since the double percentage calls a variable, but if the variable is empty, it prints its name, so if we have a variable called "X" and its content is "3", when we say it
echo %X%
will print "3" but if this variable is empty or not defined, then it will print "X".