批处理模拟按键格,下面的功能是打开任务管理器
mshta vbscript:createobject("wscript.shell").sendkeys("+^{esc}")(window.close)
键 参数
退格键: {BACKSPACE}、{BS} 或 {BKSP}
退格键: {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~F12: {F2} ~{F12}
键 特殊字符
SHIFT: +
CTRL: ^
ALT: %
出处:http://cleris.lofter.com/post/1d5ffa_5f4a15
=======================================================================================
需求描述
我有个软件,运行后,需要输入密码:111111,然后点确定,才能运行。
用bat能否实现自动模拟键盘输入密码,模拟鼠标点击确定,让这个软件自动运行呢?
如果bat不能实现,用什么方法可以实现?
解决方法:
@echo off if "%1" == "h" goto begin mshta vbscript:createobject("wscript.shell").run("%~fs0 h",0)(window.close)&&exit :begin rem 下边开始写批处代码了(适合全自动场合) taskkill /f /im thirdIO20.exe taskkill /f /im CCS.exe taskkill /f /im ccsSvcLg.exe taskkill /f /im CCS_Door.exe del /f /q c:\test.vbs (echo set wshell=createobject^("wscript.shell"^) echo wshell.run """F:\上机管理\CCS20\CCS.exe""",1 echo wscript.sleep 15000 '15秒 echo wshell.sendkeys "111111" echo wscript.sleep 2000 '2秒 echo wshell.sendkeys "{enter}" )>"c:\test.vbs" ping 127.0.0.1 -n 5 >nul 2>nul start F:\上机管理\CCS20\thirdIO20.exe ping 127.0.0.1 -n 5 >nul 2>nul start c:\test.vbs ping 127.0.0.1 -n 20 >nul 2>nul start F:\上机管理\CCSSvcLg\ccsSvcLg.exe ping 127.0.0.1 -n 10 >nul 2>nul del /f /q c:\test.vbs f: cd\ cd F:\上机管理\CCSDoor20\ start CCS_Door.exe ping 127.0.0.1 -n 5 >nul 2>nul exit
出处:http://www.bathome.net/thread-14952-1-1.html
=======================================================================================
标签:exe,批处理,wscript,echo,vbs,0.1,nul,mshta From: https://www.cnblogs.com/mq0036/p/18258939