不显示批处理变量? [英] Not-display a batch variable?

查看:108
本文介绍了不显示批处理变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个批处理文件,可以将内容回传到另一个文件中。我希望它将%prompt%回显到文件中。我不希望它显示变量,因为它尚未定义。我怎样才能使它回显纯文本。所以,如果%提示%== 4我希望它回显%提示%而不是值4.



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





有时我会添加为什么我需要这个...我正在批量生产另一种语言。它会让人们编写脚本自己的聊天机器人有点像chatscript(这激发了我的灵感)它激发了我的灵感,因为我无法使用它,因为我无法使用它。所以我找到了另一种选择。制作我自己的!



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!

推荐答案

如果你的意思是你想要bot.temp文件包含字符串

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


这篇关于不显示批处理变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆