当前位置:网站首页>How to realize the automatic message sending function of wechat with vbs
How to realize the automatic message sending function of wechat with vbs
2022-04-21 21:48:00 【Billion speed cloud】
How to use it? vbs Realize the automatic message sending function of wechat
This article mainly introduces how to use it vbs Realize the relevant knowledge of wechat automatic message sending function , The content is detailed and easy to understand , The operation is simple and fast , It has certain reference value , I believe you can use it after reading this article vbs Realize the automatic message sending function of wechat, and articles will gain something , Let's have a look .
1、 Wechat auto reply message
WeChat , As the hottest and hottest social software recently , It should be a household name , Young people , Old people and even children are playing wechat with their mobile phones , For office workers, the most used version may be wechat computer version , We manually input, send or reply to all kinds of wechat messages every day , Inevitably, we will encounter some situations. We need the computer to automatically send messages to the designated person for us , And the use of windows Medium vbs We can implement , Let's first get to know vbs.
vbs, Full name Microsoft Visual Basic Script Edition, It is a software developed by Microsoft based on Visual Basic Scripting language , Can be in windows Open it directly on the computer .
stay vbs We can pass sendkeys Easily simulate sending all kinds of keys and text , But sending Chinese characters directly will be garbled , So we need to put the Chinese characters to be sent into the clipboard first, and then take out the content from the clipboard and send , stay cmd We can connect through pipes echo and clip.exe To put the content into the clipboard ,
echo test | clip.exe stay cmd Enter the above command in the command line window , You'll find that “ test ” These two characters are put into the clipboard , stay vbs In, we only need to call this command to put the content into the clipboard ws.Run "cmd.exe /c echo test | clip.exe", 0, True Now we know that if you send a message , Also know how to send Chinese , But to send messages to wechat, we also need to know how to wake up wechat under any interface , For general applications, we can use appActivate To activate the window , Of course, we can also use shortcut keys to wake up a software or perform specific operations , For example, in wechat, we can use Ctrl+Alt+W To wake up wechat , use Ctrl+F To wake up find friends .
Wake up wechat via shortcut key and send the final code :
Dim name,Msg,num ' Define memory variables and allocate them 'Inputbox() Function name=Inputbox(" Please enter who you want to send a message to ")Msg=Inputbox(" Please enter the content of your message ")num=Inputbox(" Please enter how many times the message is sent repeatedly ")set ws=wscript.createobject("wscript.shell")' establish Windows Of shell Object open shell window ' stay Windows Of shell Window execution cmd.exe /c echo " & Name & " | clip.exe" take name Copy to the clipboard ws.Run "cmd.exe /c echo " & Name & " | clip.exe",0,Truews.Run "mshta javascript:window.execScript('window.close','vbs')",0,Truews.sendKeys "^%w" ' adopt Ctrl+Alt+W Shortcut key to open wechat wscript.sleep 500ws.sendKeys "^f" ' perform ctrl + F The shortcut key wakes up the search function in the wechat window wscript.sleep 500ws.sendKeys "^v" ' Paste the to search namewscript.sleep 500ws.sendKeys "{ENTER}" ' By keyboard enter key , Enter the to send a message name Contact window wscript.sleep 500' stay Windows Of shell Window execution cmd.exe /c echo " & Name & " | clip.exe" Copy the content of the sent message to the clipboard ws.Run "cmd.exe /c echo " & Msg & " | clip.exe",0,True wscript.sleep 500for i=1 to num ' Cycle to send num Time ws.sendKeys "^v" ' Paste the to send msg The message content wscript.sleep 500ws.sendKeys "{ENTER}" ' Press enter Key to send next
Through execution WeChat.exe Wake up the final code of sending messages via wechat :
dim program1,name,Msg ' Define memory variables and allocate them 'Inputbox() Function name=Inputbox(" Please enter who you want to send a message to ") Msg=Inputbox(" Please enter the content of your message ")num=Inputbox(" Please enter how many times the message is sent repeatedly ")'program1 Express WeChat.exe The location of 'program1="D:\other-systems\WeChat\WeChat.exe"'program1="D:\other-systems\QQ\Bin\QQ.exe"program1=Inputbox(" Please enter WeChat.exe or QQ.exe Storage location ")set wshshell=CreateObject("wscript.shell") ' establish Windows Of shell Object open shell window ' stay Windows Of shell Window execution cmd.exe /c echo " & Name & " | clip.exe" take name Copy to the clipboard wshshell.Run "cmd.exe /c echo " & Name & " | clip.exe",0,Truewshshell.Run "mshta javascript:window.execScript('window.close','vbs')",0,True' Open wechat window through absolute path set oexec=wshshell.exec(program1)wscript.sleep 500 ' Stop 500 millisecond wshshell.sendKeys "^f" ' perform ctrl + F The shortcut key wakes up the search function in the wechat window wscript.sleep 500 wshshell.sendKeys "^v" ' Paste the to search namewscript.sleep 500wshshell.sendKeys "{ENTER}" ' By keyboard enter key , Enter the to send a message name Contact window wscript.sleep 500' stay Windows Of shell Window execution cmd.exe /c echo " & Name & " | clip.exe" Copy the content of the sent message to the clipboard wshshell.Run "cmd.exe /c echo " & Msg & " | clip.exe",0,Truewscript.sleep 500for i=1 to num ' Cycle to send num Time wshshell.sendKeys "^v" ' Paste the to send msg The message content wscript.sleep 500wshshell.sendKeys "{ENTER}" ' Press enter Key to send nextwscript.quit
Of course, in addition to sending messages to wechat , It's fine too qq Send a message , The basic idea is to copy, paste and search contacts by pressing various shortcut keys on the keyboard , By pressing enter Key to send
2、vbs Script operation mode
It doesn't matter if you don't have any editors installed on your computer , You can write scripts with the notepad that comes with your computer , Right click -> newly build -> Text document , Write in a new text document vbs Script , Rename after writing , Change suffix to .vbs, The following prompt appears , Choice is .

Double click to run vbs The script .
About “ How to use it? vbs Realize the automatic message sending function of wechat ” That's all for this article , Thank you for reading ! I'm sure you're right “ How to use it? vbs Realize the automatic message sending function of wechat ” Knowledge has a certain understanding , If you want to learn more , Welcome to the Yisu cloud industry information channel .
版权声明
本文为[Billion speed cloud]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204212147081133.html
边栏推荐
- mybtais的mapper中使用@Select注解使用if
- 我国工业互联网产业发展成效显著,但技术挑战仍是一项长期工程
- Authing officially joined the W3C organization and will participate in the formulation of relevant international standards
- OA form design case display
- MySQL多表查询小练习
- 在线YAML转Properties工具
- GStreamer learning
- Idea operates redis on Linux through jedis; Failed to connect to any host resolved for DNS name
- Relationship between RFCs
- mysql 模糊搜索与校对规则
猜你喜欢

Workflow process setting customization development

清洁机器人--红外下视传感器,检测是否存在地面距离突变的情形

动态规划:完全背包问题

Add subtitles to PR video

Seven schemes of implementing distributed lock based on redis

Tgip-cn 038 registration | in depth analysis of Apache pulsar source code reading correct posture (I)

【JVM】10道不得不会的JVM面试题

一加连发两款耳机产品:充电10分钟 听歌20小时

js实现公告自动滚动

Push to origin/master was rejected:报错解决办法
随机推荐
[test case level definition]
Redis+Caffeine两级缓存,让访问速度纵享丝滑
GStreamer learning
Add subtitles to PR video
Case display of document management system
常用sql优化
The @ select annotation is used in the mapper of mybtais, and the if annotation is used
Use try-with-resources or close this “FileOutputStream“
mybtais的mapper中使用@Select注解使用if
外包学生管理系统的架构文档
redis配置文件详解
RFC 之间的关系
TCP / IP protocol
avformat_ new_ Stream understanding
Authing officially joined the W3C organization and will participate in the formulation of relevant international standards
OA form design case display
Successful cases of project management system development
[music suitable for programming]
【JVM】10道不得不会的JVM面试题
Various DNS: Baidu DNS / Alibaba DNS / 114dns / Tencent DNS / Google DNS / OpenDNS comparison evaluation