sendkeys    用于输入键盘按键

appactivate 用于聚焦程序

on error resume next

set ws = createObject("wscript.shell")

appactiveate可以指定title 或者 pid

如下

(1)指定标题

ws.run "notepad.exe"

wscript.sleep 1000

ws.appactivate("无标题-记事本")

ws.sendkeys "abc"

wscript quit

因为脚本运行速度 大于 记事本打开速度 ,因此需要延迟1秒

(2)指定pid

ws.run "calc"

wscript.sleep 1000

ws.appactivate("2936")

ws.sendkeys "35"

wscript.quit

在记事本上写内容

ws.run "notepad.exe"

wscript.sleep 1000

ws.appactivate "无标题-记事本"

ws.sendkeys "{capslock}abc{enter}"

ws.sendkeys "{capslock}+ab+c{enter}"

ws.sendkeys "+(abc)"

在记事本上指定按键数量

ws.run "notepad.exe"

wscript.sleep 1000

ws.sendkeys "{tab 6} {H 3}"

ws.sendkeys "{ }"  '发送空格

在记事本上写出中文

ws.run "echo 此处输入你想输入的中文>test.txt"

ws.run "start test.txt"

wscript.sleep 300

sendkeys && appactivate的更多相关文章

  1. sendkeys用法详解

    将一个或多个按键消息发送到活动窗口,就如同在键盘上进行输入一样. 语法 SendKeys string[, wait] SendKeys 语句的语法具有以下几个命名参数: 部分 描述   string ...

  2. VBS基础篇 - 杂项 - Sendkeys

    VBS基础篇 - 杂项 - Sendkeys   模拟键盘操作,将一个或多个按键指令发送到指定Windows窗口来控制应用程序运行 其使用格式为:object.SendKeys(string) obj ...

  3. wshShell.SendKeys模拟键盘操作

    Dim wshShellSet wshShell = CreateObject("Wscript.Shell")wshShell.SendKeys "{ENTER}&qu ...

  4. vbs SendKeys技术 vbs SendKeys

    简单说,这个命令就是模拟键盘操作,将一个或多个按键指令发送到指定Windows窗口来控制应用程序运行,其使用格式为:object.SendKeys string"object":表 ...

  5. Selenium_IEDriver操作sendkeys输入速度太慢

    通过调用64位IEDriverServer来操控sendkeys方式时,输入速度非常慢.网上说是64位有bug. 解决办法: 使用32位IEDriverServer.

  6. 解决在CAPSLOCK开启情况下sendkeys大小写异常的问题

    http://files.cnblogs.com/files/liuzhaoyzz/sendkeys%E5%A4%A7%E5%B0%8F%E5%86%99.rar 首先利用GetKeyState(vb ...

  7. C# 模拟键盘操作--SendKey(),SendKeys()

    模拟键盘输入就是使用以下2个语法实现的.SendKeys.Send(string keys);  //模拟汉字(文本)输入SendKeys.SendWait(string keys); //模拟按键输 ...

  8. 在chrome下的文本框sendkeys,提示element can't focus--解决方法

    在chrome下的文本框sendkeys,提示element can't focus--解决方法(成都-半步流雲,群友解决) 成都-半步流雲1.升级你的chromedriver,2.降chrome版本 ...

  9. SendKeys:基本使用

    使用SendKeys将键击和组合键击发送到活动应用程序.此类无法实例化.若要发送一个键击给某个类并立即继续程序流,请使用Send.若要等待键击启动的任何进程,请使用SendWait. 每个键都由一个或 ...

随机推荐

  1. 【转并修改】VS2013 MVC Web项目使用内置的IISExpress支持局域网内部机器(手机、PC)访问、调试

    转:http://www.cnblogs.com/ShaYeBlog/p/4072074.html VS2013内置了IISExpress.做asp.net MVC的web项目开发时,Ctrl+F5和 ...

  2. op论坛,分支

    http://www.arm9home.net/thread.php?fid=68 http://www.openwrt.org.cn/bbs/forum.php https://dev.openwr ...

  3. jQuery对象和DOM对象原来不一样啊

    jQuery对象和DOM对象使用说明,需要的朋友可以参考下.1.jQuery对象和DOM对象第一次学习jQuery,经常分辨不清哪些是jQuery对象,哪些是 DOM对象,因此需要重点了解jQuery ...

  4. android 获取设备唯一标识完美解决方案

    /** * deviceID的组成为:渠道标志+识别符来源标志+hash后的终端识别符 * * 渠道标志为: * 1,andriod(a) * * 识别符来源标志: * 1, wifi mac地址(w ...

  5. WebTable 扩展

    # coding:utf-8 """ 页面 table处理 """ from selenium import webdriver from ...

  6. linux下出现+ ls --color=auto -l --color=auto...++ echo -ne '\033]0;root@imon-2:~'等

    [root@imon-2 ~]# cd /root/ + cd /root/ ++ echo -ne '\033]0;root@imon-2:~' [root@imon-2 ~]# ll + ls - ...

  7. [JLOI2013]卡牌游戏

    [题目描述 Description] N个人坐成一圈玩游戏.一开始我们把所有玩家按顺时针从1到N编号.首先第一回合是玩家1作为庄家.每个回合庄家都会随机(即按相等的概率)从卡牌堆里选择一张卡片,假设卡 ...

  8. map/reduce实现 排序

    import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.co ...

  9. [LeetCode] Decode Ways 解题思路

    A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' - ...

  10. poj 1193 内存分配

    好麻烦的模拟题,一次性过了就好!!!不过用了两天哦.. 小伙伴们慢慢做哦. #include <iostream> #include <list> #include <q ...