远程关机脚本

来源:互联网 发布:mac 转码软件 编辑:程序博客网 时间:2024/04/29 14:38
VBS 编写

准备工作:安装Jmail组件  4.3   4.4 4.5 几个版本的 不要选择free版,不支持pop3收邮件,pro版可以。

不要担心,看这里。  http://vdisk.weibo.com/s/Efrycd9suZYk

当当当。上代码。

do while true
Set POP3=CreateObject("JMail.POP3")
Setwshshell=wscript.createobject("wscript.shell") 
wscript.sleep 2000
POP3.Connect "账户","密码","邮箱服务器"          '接收关机命令的邮箱账号,密码,以及对应服务器。

 For I=1 To POP3.Count '搜索全部邮件
     Subject=POP3.Messages.Item(I).Subject  
     FromAddress=POP3.Messages.Item(I).From 
   ifStrComp(FromAddress,"xxxx@gmail.com")=0then 
                                   'xxxx@gmail.com为发送关机命令的邮箱,邮件主题为shutdown
if StrComp(Subject,"shutdown")=0 then
        POP3.DeleteSingleMessage(I)
         wshshell.run "shutdown -s -t0" 
         wscript.quit
       end if
    end if 
  Next  
  POP3.Disconnect
loop


够简单了,懒人必备。

没有网的电脑,还是自己拿个棍儿戳吧。

高端操作系统(Linux,mac etc)自行绕过。

抄送 某  @不二坨  看书去!!!

0 0
原创粉丝点击