批处理文件:要求用户输入带有“建议"字样的文件. [英] Batch files: ask for user input with "suggestions"
本文介绍了批处理文件:要求用户输入带有“建议"字样的文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何提示用户答案,建议他们可以编辑的内容? 我知道如何制作类似的问答:
How can I prompt users for an answer, suggesting something they can edit? I know how to make a q&a like:
1. The sky is:
用户给出答案并:
echo For you the sky is %var%
但是我想要类似的东西:
But i want something like:
1. The sky is: Blue
echo For you the sky is Blue
但是用户可以更改
1. The sky is: Green
echo For you the sky is Green
我不知道我是否清楚,如果不知道,请告诉我. 谢谢
I don't know if i was clear, tell me if not. Thanks
推荐答案
之前用颜色初始化变量:
Initialize the variable before with a color:
@echo off&setlocal
set "color=Blue"
set/p "color=For you the sky is %color% (hit enter for o.k. or type in other color): "
echo For you the sky is %color%
这篇关于批处理文件:要求用户输入带有“建议"字样的文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文