|
每天需要微信群发送指定内容的消息,想用vbs完成,网上搜了段代码,如下:
Dim Name,Msg
Name= "微信团队"
Msg = "Hellow!"
set ws=wscript.createobject("wscript.shell")
ws "mshta vbscript:ClipboardData.SetData("&chr(34)&"text"&chr(34)&"," &Chr(34)& Name&Chr(34)& ")(close)",0,True
ws.sendKeys "^%w"
ws.appactivate "微信"
wscript.sleep 500
ws.sendKeys "^f"
wscript.sleep 500
ws.sendKeys "^v"
wscript.sleep 500
ws.sendKeys "{ENTER}"
wscript.sleep 200
ws.sendKeys "{TAB}"
wscript.sleep 200
ws.sendKeys "{ENTER}"
ws "mshta vbscript:ClipboardData.SetData("&chr(34)&"text"&chr(34)&"," &Chr(34)& Msg &Chr(34)& ")(close)",0,True
wscript.sleep 200
ws.sendKeys "^v"
wscript.sleep 300
ws.sendKeys "{ENTER}"
ws.sendKeys "%{F4}"
实测无效,请问有没有达人帮助修改下,谢谢! |
|