|
47cc
新手上路

积分 15
发帖 6
注册 2007-3-30
状态 离线
|
『楼 主』:
怎么让BAT按顺序按下键盘(1秒后)A、(2秒后)B。。。
使用 LLM 解释/回答一下
怎么让BAT按顺序按下键盘的(1秒后)A、(2秒后)B、(5秒后)C
How to make a BAT press the keyboard keys A (after 1 second), B (after 2 seconds), C (after 5 seconds) in sequence
|
|
2007-4-6 07:41 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
bat不行,建议用vbs。
Batch script is not suitable, it is recommended to use VBScript.
|
|
2007-4-6 08:09 |
|
|
47cc
新手上路

积分 15
发帖 6
注册 2007-3-30
状态 离线
|
|
2007-4-6 08:37 |
|
|
wudixin96
银牌会员
    
积分 1928
发帖 931
注册 2007-1-6
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
类似如下:
set wshell=WScript.CreateObject("WScript.Shell")
wshell.SendKeys "A"
set wshell=WScript.CreateObject("WScript.Shell")
wshell.SendKeys "A"
|
|
2007-4-6 08:48 |
|
|
bjsh
银牌会员
    
积分 2000
发帖 621
注册 2007-1-1
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
延时用
wscript.sleep 1000 ..............延时1秒
Delay used
wscript.sleep 1000 ..............Delay 1 second
|
|
2007-4-6 08:50 |
|
|
47cc
新手上路

积分 15
发帖 6
注册 2007-3-30
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
麻烦写详细点3Q
Please provide the Chinese content that needs to be translated.
|
|
2007-4-6 08:55 |
|
|
bjsh
银牌会员
    
积分 2000
发帖 621
注册 2007-1-1
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
set wshell=WScript.CreateObject("WScript.Shell")
wscript.sleep 1000
wshell.SendKeys "A"
wscript.sleep 1000
wshell.SendKeys "B"
wscript.sleep 3000
wshell.SendKeys "C"
set wshell=WScript.CreateObject("WScript.Shell")
wscript.sleep 1000
wshell.SendKeys "A"
wscript.sleep 1000
wshell.SendKeys "B"
wscript.sleep 3000
wshell.SendKeys "C"
|
|
2007-4-6 08:59 |
|
|
wudixin96
银牌会员
    
积分 1928
发帖 931
注册 2007-1-6
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
set wshshell=WScript.CreateObject("WScript.Shell")
for i=0 to 25
wshshell.SendKeys chr(65+i)
WScript.sleep 1000
next
```set wshshell=WScript.CreateObject("WScript.Shell")
for i=0 to 25
wshshell.SendKeys chr(65+i)
WScript.sleep 1000
next```
|
|
2007-4-6 09:10 |
|
|
47cc
新手上路

积分 15
发帖 6
注册 2007-3-30
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
那键盘中的“WIN”、“ESC”、"Enter"等键要用什么表示?
Then how should the keys like "WIN", "ESC", "Enter" in the keyboard be represented?
|
|
2007-4-7 01:32 |
|
|
everest79
金牌会员
      一叶枝头,万树皆春
积分 2564
发帖 1127
注册 2006-12-25
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
win=ctrl+esc,其它的嘿嘿,你写上就行了
win=ctrl+esc, others, he he, you just write it down
|
|
2007-4-7 01:40 |
|
|
wudixin96
银牌会员
    
积分 1928
发帖 931
注册 2007-1-6
状态 离线
|
   『第 11 楼』:
使用 LLM 解释/回答一下
SendKeys 方法
请参阅
WshShell 对象 | Run 方法
将一个或多个键击发送到活动窗口(仿佛是在键盘上击键一样)。
object.SendKeys(string)
参数
object
WshShell 对象。
string
表示要发送的键击(一个或多个)的字符串值。
说明
使用 SendKeys 方法可以将键击发送到无自动化界面的应用程序中。多数键盘字符都可用一个键击表示。某些键盘字符由多个键击组合而成(例如,CTRL+SHIFT+HOME)。要发送单个键盘字符,请将字符本身作为 string 参数发送。例如,要发送字母 x,则请发送 string 参数 "x"。
注意 要发送空格,则请发送字符串 " "。
可使用 SendKeys 同时发送多个键击。为此,可将每个键击按顺序排列在一起,以此来创建表示一系列键击的复合字符串参数。例如,要发送键击 a、b 和 c,则需要发送字符串参数 "abc"。SendKeys 方法将某些字符用作字符的修饰符(而不使用其本身的含义)。这组特殊的字符可包括圆括号、中括号、大括号,以及:
加号 "+"、
插入记号 "^"、
百分号 "%"、
和“非”符号 "~"。
用大括号 "{}" 括起这些字符可以发送它们。例如,要发送加号,请使用字符串参数 "{+}"。SendKeys中使用的中括号 "[ ]" 无任何特殊含义,但是必须把它们括在大括号中,以便容纳确实要赋予其特殊含义的应用程序(例如,对于动态数据交换 (DDE) 就是这样)。
要发送左中括号字符,请发送字符串参数 "{[]";要发送右中括号字符,请发送字符串参数 "{]}"。
要发送左大括号字符,请发送字符串参数 "{{}";要发送右大括号字符,请发送字符串参数 "{}}"。
某些键击不生成字符(如 ENTER 和 TAB)。某些键击表示操作(如 BACKSPACE 和 BREAK)。要发送这些类型的键击,请发送下表中列出的参数:
键 参数
退格键 {BACKSPACE}、{BS} 或 {BKSP}
BREAK {BREAK}
CAPS LOCK {CAPSLOCK}
DEL 或 DELETE {DELETE} 或 {DEL}
向下键 {DOWN}
END {END}
ENTER {ENTER} 或 ~
ESC {ESC}
HELP {HELP}
HOME {HOME}
INS 或 INSERT {INSERT} 或 {INS}
向左键 {LEFT}
NUM LOCK {NUMLOCK}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
PRINT SCREEN {PRTSC}
向右键 {RIGHT}
SCROLL LOCK {SCROLLLOCK}
TAB {TAB}
向上键 {UP}
F1 {F1}
F2 {F2}
F3 {F3}
F4 {F4}
F5 {F5}
F6 {F6}
F7 {F7}
F8 {F8}
F9 {F9}
F10 {F10}
F11 {F11}
F12 {F12}
F13 {F13}
F14 {F14}
F15 {F15}
F16 {F16}
要发送由常规键击和 SHIFT、CTRL 或 ALT 组合而成的键盘字符,请创建表示该键击组合的复合字符串参数。可通过在常规键击之前添加一个或多个以下特殊字符来完成上述操作:
键 特殊字符
SHIFT +
CTRL ^
ALT %
注意 这样使用时,不用大括号括起这些特殊字符。
要指定在按下多个其他键时,按下 SHIFT、CTRL 和 ALT 的组合,请创建复合字符串参数,用括号括起其中的组合键。例如,要发送的组合键指定:
如果在按 e 和 c 的同时按 SHIFT 键,则发送字符串参数 "+(ec)"。
如果在按 e 时只按 c(而不按 SHIFT),则发送字符串参数 "+ec"。
可使用 SendKeys 方法发送一种在一行内重复按键的键击。为此,要创建复合字符串参数,以指定要重复的键击,并在其后指定重复次数。可使用 {键击 数字} 形式的复合字符串参数来完成上述操作。例如,如果要发送 10 次 "x",则需要发送字符串参数 "{x 10}"。请确保在键击和数字之间有一个空格。
注意 只可以发送重复按一个键的键击。例如,可以发送 10 次 "x",但不可发送 10 次 "Ctrl+x"。
注意 不能向应用程序发送 PRINT SCREEN 键 {PRTSC}。
SendKeys Method
See Also
WshShell Object | Run Method
Sends one or more keystrokes to the active window (as if the keys were pressed on the keyboard).
object.SendKeys(string)
Parameters
object
WshShell object.
string
String value representing the keystroke(s) to send.
Remarks
The SendKeys method can be used to send keystrokes to applications that have no automation interface. Most keyboard characters can be represented by one keystroke. Some keyboard characters are composed of multiple keystrokes (for example, CTRL+SHIFT+HOME). To send a single keyboard character, send the character itself as the string parameter. For example, to send the letter x, send the string parameter "x".
Note To send a space, send the string " ".
You can send multiple keystrokes at the same time using SendKeys. To do this, place each keystroke in sequence to create a composite string parameter representing a series of keystrokes. For example, to send the keystrokes a, b, and c, send the string parameter "abc". The SendKeys method uses certain characters as modifiers for characters (rather than using their literal meaning). This special set of characters can include parentheses, brackets, braces, and:
Plus sign "+",
Caret "^",
Percent sign "%"、
and "Tilde" symbol "~".
Enclose these characters in braces "{}" to send them. For example, to send a plus sign, use the string parameter "{+}". The brackets "" used in SendKeys have no special meaning, but must be enclosed in braces to accommodate applications that do assign them special meaning (for example, for Dynamic Data Exchange (DDE)).
To send a left bracket character, send the string parameter "{"; to send a right bracket character, send the string parameter "{]}".
To send a left brace character, send the string parameter "{{}"; to send a right brace character, send the string parameter "{}}".
Some keystrokes do not produce characters (such as ENTER and TAB). Some keystrokes represent actions (such as BACKSPACE and BREAK). To send these types of keystrokes, send the parameters listed in the following table:
Key Parameter
Backspace {BACKSPACE}, {BS}, or {BKSP}
BREAK {BREAK}
CAPS LOCK {CAPSLOCK}
DEL or DELETE {DELETE} or {DEL}
Down arrow {DOWN}
END {END}
ENTER {ENTER} or ~
ESC {ESC}
HELP {HELP}
HOME {HOME}
INS or INSERT {INSERT} or {INS}
Left arrow {LEFT}
NUM LOCK {NUMLOCK}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
PRINT SCREEN {PRTSC}
Right arrow {RIGHT}
SCROLL LOCK {SCROLLLOCK}
TAB {TAB}
Up arrow {UP}
F1 {F1}
F2 {F2}
F3 {F3}
F4 {F4}
F5 {F5}
F6 {F6}
F7 {F7}
F8 {F8}
F9 {F9}
F10 {F10}
F11 {F11}
F12 {F12}
F13 {F13}
F14 {F14}
F15 {F15}
F16 {F16}
To send keyboard characters composed of a regular keystroke and a combination of SHIFT, CTRL, or ALT, create a composite string parameter representing that keystroke combination. You can do this by adding one or more of the following special characters before the regular keystroke:
Key Special Character
SHIFT +
CTRL ^
ALT %
Note Do not enclose these special characters in braces when used this way.
To specify a combination of SHIFT, CTRL, and ALT while pressing several other keys, create a composite string parameter with the combination enclosed in parentheses. For example, to send a combination specified as:
If SHIFT is pressed while pressing e and c, send the string parameter "+(ec)".
If only c is pressed while pressing e (without pressing SHIFT), send the string parameter "+ec".
You can use the SendKeys method to send a keystroke that repeats a key press within a line. To do this, create a composite string parameter specifying the keystroke to repeat, and then specify the number of repetitions after it. You can do this using a composite string parameter in the form {keystroke number}. For example, if you want to send "x" 10 times, you need to send the string parameter "{x 10}". Make sure there is a space between the keystroke and the number.
Note You can only send keystrokes that repeat pressing a single key. For example, you can send "x" 10 times, but you cannot send "Ctrl+x" 10 times.
Note You cannot send the PRINT SCREEN key {PRTSC} to an application.
此帖被 +13 点积分 点击查看详情 评分人:【 47cc 】 | 分数: -1 | 时间:2007-4-7 01:47 | 评分人:【 9527 】 | 分数: +13 | 时间:2007-4-7 02:55 | 评分人:【 vlq5299 】 | 分数: +1 | 时间:2007-4-10 13:08 |
|
|
|
2007-4-7 01:42 |
|
|
47cc
新手上路

积分 15
发帖 6
注册 2007-3-30
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
不好意思一不小心就点错勒,把+1分点成-1勒~~以后补你哈
SORRY啊!!
Sorry! Accidentally clicked the wrong one, turned +1 point into -1~ I'll make it up to you later~~ SORRY ah!
|
|
2007-4-7 02:44 |
|
|
9527
银牌会员
     努力做坏人
积分 1185
发帖 438
注册 2006-8-28 来自 北京
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
我帮楼上的给你补上了
I helped the person upstairs to make up for you.
|

我今后在论坛的目标就是做个超级坏人!!! |
|
2007-4-7 02:56 |
|
|
wudixin96
银牌会员
    
积分 1928
发帖 931
注册 2007-1-6
状态 离线
|
|
2007-4-7 03:06 |
|
|
axi
中级用户
   脚本爱好者
积分 238
发帖 93
注册 2007-3-11 来自 GZ
状态 离线
|
|
2007-4-7 12:04 |
|