vbs脚本和windows定时任务实现qq消息表情包定时发送功能
<h2>目标</h2><p>在某个时间唤醒电脑屏幕后,自动发送qq信息,并附带表情包,发送完毕后关闭电脑屏幕。整个过程不用过多的程序运行,我们借助vbs脚本和windows定时任务去实现这一功能。</p>
<h2>准备</h2>
<p>vbs代码<br />qq信息txt文本<br />qq文件表情包文件<br />发送联系人的快捷方式<br />3个windows任务</p>
<h2>具体操作</h2>
<h3>信息和快捷方式准备</h3>
<h3>qq信息txt文本和表情包文件</h3>
<p>桌面新建文本输入要发送的信息,保存为abc.txt,</p>
<p style="text-align:center"><img alt="" src="https://img.jbzj.com/file_images/article/202201/2022011613061313.png" /></p>
<p>桌面新建文件,把要放的表情包放进里面,保存为abd</p>
<p style="text-align:center"><img alt="" src="https://img.jbzj.com/file_images/article/202201/2022011613061314.png" /></p>
<h3>qq快捷方式</h3>
<p>把联系人拖到桌面生成快捷方式,记住,qq保持登录状态</p>
<h3>vbs脚本</h3>
<p>程序具体改动见代码注释</p>
<div class="jb51code"><pre class="brush:bash;">Set objShell = CreateObject("Wscript.Shell")
WScript.Sleep 3000
objShell.SendKeys "{ESC}"
WScript.Sleep 7000 '等待时间设置7秒是为了给足时间电脑启动
objShell.SendKeys "{ESC}"
WScript.Sleep 3000
Set Shell=Wscript.Createobject("Wscript.shell")
Shell.run "C:\Users\captainzou\Desktop\abc.txt" 'qq信息文件保存地址
Wscript.Sleep 1000 '等待1秒
set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys ("^a")
Wscript.Sleep 2000 '等待1秒
WshShell.SendKeys ("^c")
Wscript.Sleep 2000 '等待1秒
WshShell.SendKeys "%{F4}"
Wscript.Sleep 1000 '等待1秒
Shell.run "C:\Users\captainzou\Desktop\tanhuang.lnk" '联系人快捷方式保存地址
Wscript.Sleep 5000 '等待5秒
WshShell.SendKeys ("^v")
Wscript.Sleep 1000 '等待1秒
WshShell.SendKeys "%{F4}"
Wscript.Sleep 2000 '等待2秒
Shell.run "C:\Users\captainzou\Desktop\abd" '表情包保存地址
Wscript.Sleep 2000 '等待2秒
WshShell.SendKeys ("^a")
Wscript.Sleep 1000 '等待1秒
WshShell.SendKeys ("^c")
Wscript.Sleep 1000 '等待1秒
WshShell.SendKeys "%{F4}"
Wscript.Sleep 1000 '等待1秒
Shell.run "C:\Users\captainzou\Desktop\tanhuang.lnk" '联系人快捷方式保存地址
Wscript.Sleep 1000 '等待1秒
WshShell.SendKeys ("^v")
Wscript.Sleep 4000 '等待4秒
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1000 '等待1秒
WshShell.SendKeys "%{F4}"
Wscript.Sleep 1000 '等待1秒</pre></div>
<p>windows自带定时任务</p>
<p style="text-align:center"><img alt="" src="https://img.jbzj.com/file_images/article/202201/2022011613061315.png" /></p>
<p>唤醒电脑</p>
<p>在“此电脑”右键后点击管理,找到任务计划程序,点击“创建任务”,输入名称“唤醒电脑”,在常规中勾上“使用最高权限运行”,在触发器中填入唤醒时间,在操作中输入程序“notepad.exe”,在条件中勾上“唤醒计算机运行此任务”。然后确定即可。</p>
<p style="text-align:center"><img alt="" src="https://img.jbzj.com/file_images/article/202201/2022011613061416.png" /></p>
<p>发送信息</p>
<p>基本与唤醒电脑一致,注意的是要选择合适的发送时间,以及要在操作中浏览选择vbs脚本。</p>
<p style="text-align:center"><img alt="" src="https://img.jbzj.com/file_images/article/202201/2022011613061417.png" /></p>
<p>关闭电脑</p>
<p>基本与唤醒电脑一致,注意的是在操作中,输入程序“shutdown.exe",并且添加参数”-h“。</p>
<p><img alt="" src="https://img.jbzj.com/file_images/article/202201/2022011613061418.png" /></p>
<p>最后</p>
<p>电脑出现4个图标后就可以躺下等待半夜自动发送信息了。<br />qq保持登录状态,然后电脑休眠就行了。</p>
<p style="text-align:center"><img alt="" src="https://img.jbzj.com/file_images/article/202201/2022011613061419.png" /></p>
<p>qq发送信息后就关机了。</p>
<p style="text-align:center"><img alt="" src="https://img.jbzj.com/file_images/article/202201/2022011613061420.png" /></p>
頁:
[1]