3个回答
展开全部
@echo off
cd.>o.txt&start o.txt
set "str1=If CreateObject^("wscript.Shell"^).AppActivate"
set "str2=^("o.txt"^)=True Then CreateObject"
set "str3=^("wscript.Shell"^).SendKeys "123456789{esc}""
echo %str1%%str2%%str3% >o.vbs
ping /n 1 127.1>nul&o.vbs&del o.txt,o.vbs
你试试!但是在记事本里按esc是看不到效果的哦.你可以改成enter试.
可以不生成VBS,如下是按NUMLOCK键的:
mshta vbscript:createobject("wscript.shell").sendkeys("{numlock}")(close)
cd.>o.txt&start o.txt
set "str1=If CreateObject^("wscript.Shell"^).AppActivate"
set "str2=^("o.txt"^)=True Then CreateObject"
set "str3=^("wscript.Shell"^).SendKeys "123456789{esc}""
echo %str1%%str2%%str3% >o.vbs
ping /n 1 127.1>nul&o.vbs&del o.txt,o.vbs
你试试!但是在记事本里按esc是看不到效果的哦.你可以改成enter试.
可以不生成VBS,如下是按NUMLOCK键的:
mshta vbscript:createobject("wscript.shell").sendkeys("{numlock}")(close)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
批处理不能直接模拟键盘输入
用批处理生成VBS模拟键盘输入就可以
------------------------------------
echo Set WshShell = WScript.CreateObject("WScript.Shell") >1.VBS
echo wshshell.sendkeys "^{ESC}+u" >>1.VBS
start /wait 1.VBS
del 1.vbs
-------------------------------------
上面是用批处理生成VBS模拟键盘关机的..
用批处理生成VBS模拟键盘输入就可以
------------------------------------
echo Set WshShell = WScript.CreateObject("WScript.Shell") >1.VBS
echo wshshell.sendkeys "^{ESC}+u" >>1.VBS
start /wait 1.VBS
del 1.vbs
-------------------------------------
上面是用批处理生成VBS模拟键盘关机的..
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
@echo off
>a.vbs echo set WshShell = CreateObject("WScript.Shell")
>>a.vbs echo WshShell.Run "c:\windows\system32\notepad.exe"
>>a.vbs echo WScript.Sleep 100
>>a.vbs echo WshShell.AppActivate "无标题-记事本"
>>a.vbs echo WScript.Sleep 100
for /l %%i in (1,1,9)do echo WScript.Sleep 200>>a.vbs&&echo WshShell.SendKeys "%%i">>a.vbs
a.vbs
>a.vbs echo set WshShell = CreateObject("WScript.Shell")
>>a.vbs echo WshShell.Run "c:\windows\system32\notepad.exe"
>>a.vbs echo WScript.Sleep 100
>>a.vbs echo WshShell.AppActivate "无标题-记事本"
>>a.vbs echo WScript.Sleep 100
for /l %%i in (1,1,9)do echo WScript.Sleep 200>>a.vbs&&echo WshShell.SendKeys "%%i">>a.vbs
a.vbs
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询