酒水不犯茶水


叶的离去,是风的追求还是树的不挽留?
数据加载中……
VBS解决终端窗口中特殊快捷键问题
写程序麻烦,还要传上去,幸好VBS每台服务器应该都可以运行的吧,很少会又禁止的
使用SendKeys搞定
例如呼出Cain使用如下脚本:)
Set WshShell= Wscript.CreateObject("Wscript.Shell")
Wscript.Sleep 1500
WshShell.SendKeys "%{PGUP}"

以下位SendKeys的相关使用方法等

SendKeys Method

Description

The SendKeys method is used to send keystrokes to the currently active window as if they where typed from the keyboard.

object.SendKeysKeystrokes

Single alphanumeric keystrokes can simply be specified using a string representation of the character required. For example, to send the letter S the command would be object.SendKeys "S".

To send multiple characters combine them into one string. For example, to send A, B and C the command would be object.SendKeys "ABC".

The plus sign "+", caret "^", percent sign "%", tilde "~", and parentheses "()" all have special meanings and must be enclosed within braces "{}". Square brackets "[]" must also be enclosed within braces although they have no special meaning. To specify brace characters themselves, use "{{}" and "{}}".

Below is a table of characters that can not be directly represent by a keyboard character to use one of these, specify the appropriate Code.

KeyCode
Backspace{BACKSPACE}, {BKSP} or {BS}
Break{BREAK}
Caps Lock{CAPSLOCK}
Delete{DELETE} or {DEL}
Down Arrow{DOWN}
End{END}
Enter{ENTER} or ~
Escape{ESC}
Help{HELP}
Home{HOME}
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 specify characters combinations use the following codes:

KeyCode
Alt%
Ctrl^
Shift Lock+
For example to specify CTRL and C, the code would be object.SendKeys "^C" and for SHIFT F5 object.SendKeys "+{F5}". To specify multiple combination sets such as ALT A Z, you use parentheses, for example, object.SendKeys "%(AZ)".

Example

'VBScript Example
Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "%windir%\notepad.exe"
WshShell.AppActivate "Notepad"

WshShell.SendKeys "Hello World!"
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "abc"
WshShell.SendKeys "{CAPSLOCK}"
WshShell.SendKeys "def"

posted on 2007-10-15 17:27 009 阅读(346) 评论(1)  编辑  收藏 所属分类: 系统编程网页编程黑客技术经验技巧OTHERS

评论

# re: VBS解决终端窗口中特殊快捷键问题 2008-12-25 16:48 外星飞碟

好东西,真好
  回复  更多评论    


标题  
姓名  
主页
验证码 *  
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2007-10-15 17:36 编辑过

2006 © 009网站 版权没有,任意拷贝
如有意见和建议,请 E-mail 至 baicker@hotmail.com
建议使用 Firefox & 微软雅黑字体进行浏览,最佳显示 1400*1050