How can I exit a SET /p command after a certain time? For instance, if a user takes too long to input something, I want to exit the SET /p.
相关问题
- xcopy include folder
- Batch file if string starts by
- Jenkins - cmd is not recognized
- Does specifying the encoding in javac yield the sa
- String Manipulation with case sensitivity
相关文章
- 在vscode如何用code runner打开独立的控制台窗口,以及设置好调试模式时窗口的编码?
- Extracting columns from text file using Perl one-l
- How can one batch file get the exit code of anothe
- Command line escaping single quote for PowerShell
- How to make jenkins fail at a failing windows batc
- Problems using start-process to call other powersh
- Python utilizing multiple processors
- Why do all Pre-build or Post-build events in Visua
This is a pure Batch solution that avoid the problems that the Batch-JScript hybrid script have when Sendkeys is used and the original window is not in focus.
Below there is a Batch-JScript hybrid script that achieve what you want. JScript is installed with every version of Windows from XP on. Save this file with .bat extension:
Essentially, you can't.
You may be able to use
choice
to accept a single character with timeout.If a downloadable tool is permitted, you can use editv64.exe (64-bit) or editv32.exe (32-bit) with the
-t
parameter. For example:The tool has additional advantages, such as hiding the input string when typed (
-m
) as well as editing an existing environment variable interactively. You can download it here:http://www.westmesatech.com/editv.html