中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-12 04:08
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » Input question
Printable Version  712 / 1
Floor1 fitenzhou Posted 2010-08-13 09:06
新手上路 Posts 6 Credits 6
set /p name= 【Please enter username】:
1. I want it to exit directly after five minutes
2. If the input contains spaces, pressing Enter will exit. What I originally wanted was for it to return directly to the input screen
How should I handle this?
Floor2 wangyang331407 Posted 2010-08-14 17:37
初级用户 Posts 28 Credits 28
I don't know the first one. But I know a tiny bit about the second one. It may be rather troublesome, haha. After all I'm just a newbie, so please forgive me if it's not good.
@echo off
goto 0
setlocal enabledelayedexpansion

:0
set /p name=【Please enter username】:
if not [!name!]==[] ......
if [!name!]==[] echo Your input is incorrect, please enter it again.&goto 0
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023