AlphaGamer150
AlphaGamer150

Reputation: 15

Displaying % in Batch (Windows 10 Command Prompt)

I am writing a batch program that has a loading screen, because it has a lot of files to load, anyway, I was trying to get it to display:

0%

after runing the program, it only displayed:

0

Any advice or solutions would help, Thanks!

Upvotes: 1

Views: 392

Answers (2)

Prabhakar
Prabhakar

Reputation: 1192

You shall display % in console by giving %% in your batch program.

Upvotes: 0

Hackoo
Hackoo

Reputation: 18827

You should escape this special character by adding %

@echo off
echo 0%%
pause>nul

for more info about escaping characters take a look at this link : Escape Characters

Upvotes: 1

Related Questions