How to echo the variable's value containing percent signs?

8,022

You should double percent signs %%var%%

@echo off
set "var=Hello"
echo in my variable %%var%% ===^> %var%
pause
Share:
8,022

Related videos on Youtube

INTENSEFIRE
Author by

INTENSEFIRE

Updated on September 18, 2022

Comments

  • INTENSEFIRE
    INTENSEFIRE almost 2 years

    I want to echo a variable with the %'s.

    Ex:

    set var=Hello
    echo %var%
    

    That would obviously result in echoing "Hello", but how can I get it to just echo %var%?