如何在批处理文件中从控制台读取输入? [英] How to read input from console in a batch file?

查看:13
本文介绍了如何在批处理文件中从控制台读取输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在批处理文件中从控制台读取输入?我想要实现的是 C 中 scanf 的功能.如何在批处理文件中实现相同的功能?

How do I read input from the console in a batch file? What I am trying to achieve is the functionality of scanf in C. How can I do the same in a batch file?

推荐答案

链接的建议重复项中的代码片段读取用户输入.

The code snippet in the linked proposed duplicate reads user input.

ECHO A current build of Test Harness exists.
set /p delBuild=Delete preexisting build [y/n]?: 

用户可以输入任意数量的字母,它会进入到 delBuild 变量中.

The user can type as many letters as they want, and it will go into the delBuild variable.

这篇关于如何在批处理文件中从控制台读取输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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