中国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-04 03:17
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » How to make a BAT press the keyboard keys in order (after 1 second) A, (after 2 seconds) B...
Printable Version  2,415 / 22
Floor16 lxmxn Posted 2007-04-07 12:32
版主 Posts 4,938 Credits 11,386
Well received.
Floor17 vsda2008 Posted 2007-04-09 05:41
初级用户 Posts 15 Credits 34
How to send keystroke operations, friend
I still feel a bit confused after reading
Floor18 vsda2008 Posted 2007-04-09 05:45
初级用户 Posts 15 Credits 34
set wshell=WScript.CreateObject("WScript.Shell")
wscript.sleep 3000
wshell.SendKeys "2724"
wshell.SendKeys "{ENTER}"
wshell.SendKeys "lc12134"
Floor19 cy123 Posted 2007-04-09 11:39
初级用户 Posts 30 Credits 76
Isn't this okay?

@echo off
ECHO Choose A for 1 second
ECHO Choose B for 2 seconds
ECHO Choose C for 5 seconds
choice /c abc /m "Please choose A, B or C"
if errorlevel 3 goto 3
if errorlevel 2 goto 2
if errorlevel 1 goto 1

:3
ping -n 5 127.1 >nul
ECHO 5 seconds
PAUSE

:2
ping -n 2 127.1 >nul
echo 2 seconds
PAUSE

:1
ping -n 1 127.1 >nul
echo 1 second
PAUSE
Floor20 lxmxn Posted 2007-04-09 11:59
版主 Posts 4,938 Credits 11,386
What system is this? And what is choice?
Floor21 cy123 Posted 2007-04-10 09:35
初级用户 Posts 30 Credits 76
Floor22 lxmxn Posted 2007-04-10 13:01
版主 Posts 4,938 Credits 11,386
Oh, so that's how it is... I thought it was 2000 or XP.
Floor23 axi Posted 2007-04-11 13:49
中级用户 Posts 93 Credits 238 From GZ
Originally posted by cy123 at 2007-4-9 20:35:
System 2003. ..


Brother cy123, your system is 2003. There is a handy delay command (timeout) that works well. Don't you know about it?

Example:

@echo off
timeout.exe /t 1 >nul
echo I have helped you press A!
mshta vbscript:CreateObject("SAPI.SpVoice").Speak("Prees, A")(Window.close)
timeout.exe /t 1 >nul
cls
echo I have also helped you press B!
mshta vbscript:CreateObject("SAPI.SpVoice").Speak("Prees, B")(Window.close)
timeout.exe /t 3 >nul
cls
echo I have also helped you press C, goodbye!
mshta vbscript:CreateObject("SAPI.SpVoice").Speak("Prees, C, Goodbye")(Window.close)


Completely automatic and also makes sounds.

[ Last edited by axi on 2007-4-11 at 02:46 PM ]
Prev  1 2
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023