【发布时间】:2015-02-06 18:34:31
【问题描述】:
我正在寻找一种在批处理文件中接受用户输入timeout 的方法。
基本上,当批处理程序启动时,用户可以选择以分钟为单位输入超时,该超时将以秒为单位计算并作为变量传递,直到下一步继续。
很遗憾,我在网上找不到任何东西;(
@echo off
REM set timeout by using the input of the user
shutdown -f -s -t (here comes in user input * 60)
用 CMD 可以实现这样的事情吗?
【问题讨论】:
-
您搜索了哪些确切的字符串?因为
set /p会做你想做的事。 -
我确实找到了
set /p,但我无法理解。 -
set /p 的用法是
set /p variable=prompt,其中prompt是脚本在请求输入时向用户显示的内容,variable是存储输入的变量。跨度>
标签: windows batch-file cmd windows-7-x64