Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BATCH- echo % (print an percent sign) [duplicate]

In my program i made it so that it shows 20% or 2% but the percent signs don't show. Any way you to display the percentage symbol?

(This is for minimal character limit don't bother looking down here)

like image 803
Jumperz Ko Avatar asked Aug 21 '15 22:08

Jumperz Ko


People also ask

How do I use percent characters in a batch file?

One other place where a percent character is used is as the modulus operator in the SET /A command, in a batch file this should always be passed as a pair of double %%'s. You might expect that to create the variable %1%, but in a batch file it will Fail.

How do I escape the percent sign in a file?

In batch files, the percent sign may be "escaped" by using a double percent sign ( %% ). If part of a command line though you still need a ^ if you are trying to escape a variable, placing the ^ inside the variable name will stop it expanding.

What is echo command in batch script?

Batch Script - ECHO 1 ECHO. This batch command displays messages, or turns command echoing on or off. 2 Syntax. 3 Example. The following example shows the different variants of the dir command. 4 Output. The following output will be displayed in the command prompt. More ...

How to use the% symbol in a batch file?

To answer this we need to consider all the things in the batch language which use the % symbol: Firstly command line parameters %0 %1 %2 %3 ... Next the FOR command, while most people will sensibly choose parameter letters like %A or %F or %Z, it is perfectly possible to choose numbers %1 %2 %3 ...


1 Answers

Doubling the percent sign will print one percent sign:

echo %%
like image 189
foxidrive Avatar answered Oct 18 '22 18:10

foxidrive