Snoop05
Snoop05

Reputation: 55

ECHO %VAR% to FILE (Not value of %VAR%, but text "%VAR%")

%VAR%=VARIABLE

I need to echo %VAR% to file so after command:

ECHO %VAR% > FILE.TXT 

content of FILE.TXT will be:

%VAR%

But since %VAR% was defined and assigned value, file will look like

VARIABLE

What do i need to add to my command to make it echo %VAR% and not the value?

Upvotes: 0

Views: 67

Answers (1)

BambiLongGone
BambiLongGone

Reputation: 154

You could turn on local variables and set %var% to blank.

You can also escape it with the caret. echo ^%var^%

See setlocal /?

Upvotes: 2

Related Questions