Click here to Skip to main content
15,038,345 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a batch file that echoes stuff into another file. I want it to echo %prompt% into a file. I don't want it to display the variable because it isn't defined yet. How can I make it echo plain text. so like if %prompt%==4 I want it to echo %prompt% not the value 4.

cd Temp
set s=
set /p s=:
echo if %query%==%s% ( >> bot.temp
cd..
cd..
make


Sometimes I add why I need this... Im making another language out of batch. It will let people script their own chatbot kind of like chatscript(Which inspired me to make this) it inspired me because I couldn't use it since I couldn't get it to work. So I found an alternative. Make my own!
Posted

1 solution

If you mean that your want the bot.temp file to contain the string
if %query%==%s% (

Then it's pretty simple: double up the '%' character.
echo if %%query%%==%%s%% ( >> bot.temp
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900