How do i output a variable reference to another batch file?

i want to output this line to another batch file but have the variable name output exactly as it is.

echo %testvariable% >> test.bat

That would output whatever the variable is.

But how can i get it to output character for character %testvariable%

"%testvariable" - i want to output the words including the percent signs.

Thanks in Advance :P
2 answers Last reply Best Answer
More about output variable reference batch file
  1. Best answer
    Ok... this presented a challenge in obscure batch file scripting (something I haven't had to do in years!

    If I understand your stated objective correctly, you want to create a secondary file that contains the literal output of %testvariable%

    To do this the command would be:

    echo %%testvariable%% >>test.bat

    Hope this helps!
  2. Best answer selected by RecoJohnson.
Ask a new question

Read More

Windows XP