如何用批处理模拟键盘?
打开一文件后,自动再按下回车键比如我要打开D:\ProgramFiles\tool\1\1.exe然后回车,怎么弄一起再打一下,我弄不好啊...
打开一文件后,自动再按下回车键
比如我要打开D:\Program Files\tool\1\1.exe
然后回车,怎么弄
一起再打一下,我弄不好啊 展开
比如我要打开D:\Program Files\tool\1\1.exe
然后回车,怎么弄
一起再打一下,我弄不好啊 展开
3个回答
展开全部
问题补充:比如我要打开D:\Program Files\tool\1\1.exe
回答:运行命令 start "" "D:\Program Files\tool\1\1.exe"
批处理没有这样的命令,用VBS吧。把以下内容保存为 "测试.vbs" 文件运行就可以了。测试内容是打开记事本,然后打入good,回车,然后打入good,回车,然后打入ok
set WshShell = CreateObject("WScript.Shell")
WshShell.Run "notepad"
WScript.Sleep 1000
WshShell.SendKeys "+G"
WScript.Sleep 1000
WshShell.SendKeys "+o"
WScript.Sleep 1000
WshShell.SendKeys "+o"
WScript.Sleep 1000
WshShell.SendKeys "+d"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "+G"
WScript.Sleep 1000
WshShell.SendKeys "+o"
WScript.Sleep 1000
WshShell.SendKeys "+o"
WScript.Sleep 1000
WshShell.SendKeys "+d"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "+o"
WScript.Sleep 1000
WshShell.SendKeys "+k"
回答:运行命令 start "" "D:\Program Files\tool\1\1.exe"
批处理没有这样的命令,用VBS吧。把以下内容保存为 "测试.vbs" 文件运行就可以了。测试内容是打开记事本,然后打入good,回车,然后打入good,回车,然后打入ok
set WshShell = CreateObject("WScript.Shell")
WshShell.Run "notepad"
WScript.Sleep 1000
WshShell.SendKeys "+G"
WScript.Sleep 1000
WshShell.SendKeys "+o"
WScript.Sleep 1000
WshShell.SendKeys "+o"
WScript.Sleep 1000
WshShell.SendKeys "+d"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "+G"
WScript.Sleep 1000
WshShell.SendKeys "+o"
WScript.Sleep 1000
WshShell.SendKeys "+o"
WScript.Sleep 1000
WshShell.SendKeys "+d"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "+o"
WScript.Sleep 1000
WshShell.SendKeys "+k"
展开全部
星号以下的代码另存为1.vbs,打开D:\Program Files\tool\1\1.exe后5秒按回车
*************************************
Dim Shell
Set Shell=WScript.CreateObject("WScript.Shell")
Shell.Run "D:\Program Files\tool\1\1.exe"
WScript.Sleep 5000
Shell.SendKeys "{ENTER}"
*************************************
Dim Shell
Set Shell=WScript.CreateObject("WScript.Shell")
Shell.Run "D:\Program Files\tool\1\1.exe"
WScript.Sleep 5000
Shell.SendKeys "{ENTER}"
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
键盘记录需要设计keyhook键盘钩子,批处理不具备此能力,你需要使用支持windows
api的编程工具编程,因为它需要提升进程权限、设置键盘挂钩、磁盘文件操作。
例如:vb、.net、c++、delphi这些都可以
api的编程工具编程,因为它需要提升进程权限、设置键盘挂钩、磁盘文件操作。
例如:vb、.net、c++、delphi这些都可以
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询