Search found 3 matches
- 15 Apr 2017 10:28
- Forum: DOS Batch Forum
- Topic: Is it possible to do "choice /t" without having a predetermined option?
- Replies: 6
- Views: 7163
Re: Is it possible to do "choice /t" without having a predetermined option?
A good way is to use a "not on keyboard" character. Like the alt+219 which is █ or alt+255 which is something like an invisible character (not tested). Then suppress the display of choices. Here is a small script. choice /c █yn /n /d █ /t 10 /m "[Y/N]" If errorlevel 3 echo No If...
- 14 Apr 2017 19:29
- Forum: DOS Batch Forum
- Topic: Is it possible to do "choice /t" without having a predetermined option?
- Replies: 6
- Views: 7163
Is it possible to do "choice /t" without having a predetermined option?
I don't know if I worded that correctly, but what I mean is: Can I do something like @echo off set "errorlevel=0" choice /c yn /t 10 if "%errorlevel%"=="1" goto yes if "%errorlevel%"=="2" goto no goto maybe I want to be able to select between two opt...
- 14 Apr 2017 12:46
- Forum: DOS Batch Forum
- Topic: Execute a command every n seconds?
- Replies: 6
- Views: 5975
Re: Execute a command every n seconds?
:LOOP <execute command here> PING -n 5 127.0.0.1>nul GOTO LOOP Why use "ping" instead of "timeout"? timeout is more precise and easier to remember. :loop <command> timeout /nobreak /t <time in seconds> > NUL goto loop Add "> NUL" at the end to hide the timeout output.