@echo off&setlocal enabledelayedexpansion
title OE收件箱监控与主题提取工具
echo.
echo.
echo.
echo OE收件箱监控与主题提取工具
echo 设置选项
echo by cjiabing cmd@xp
echo.
echo.
echo 时间控制:设置程序自动循环的时间。默认是60(约2分钟)。
set /p timec= 时间设置:
if defined timec (goto set) else (set timec=60)
:set
echo.&set /p email= 是否设置自动发送邮件?默认不设置。(y/n):
if %email%==y (call :mail) else (set cmail=echo 不发送邮件)
echo.&echo 执行程序:添加随程序执行的程序。默认是执行收件指令的batbot001.bat。
set /p Performer= 程序设置:
if defined Performer (goto set1) else (goto set2)
exit
:set1
setlocal enabledelayedexpansion
set rdm=%random%
for /f "skip=49 tokens=*" %%a in ('type %0') do echo %%a>>OETool^!rdm^!.bat
echo start ^"^" batbot001^.bat>>OETool^!rdm^!.bat
echo start ^"^" %Performer%>>OETool^!rdm^!.bat
echo ping ^/n 5 127^.0^.1^>nul>>OETool^!rdm^!.bat
echo goto ^:eof>>OETool^!rdm^!.bat
echo.&echo 退出设置并开始执行程序&pause>nul
start "" OETool^!rdm^!.bat&exit
:set2
setlocal enabledelayedexpansion
set rdm=%random%
for /f "skip=49 tokens=*" %%a in ('type %0') do echo %%a>>OETool^!rdm^!.bat
echo start ^"^" batbot001^.bat>>OETool^!rdm^!.bat
echo ping ^/n 5 127^.0^.1^>nul>>OETool^!rdm^!.bat
echo goto ^:eof>>OETool^!rdm^!.bat
echo.&echo 退出设置并开始执行程序&pause>nul
start "" OETool^!rdm^!.bat&exit
:mail
set cmail=call :send
echo.&echo 发件设置:设置程序自动发送邮件。默认不发送。
set /p smtp= SMTP/POP3(如:smtp.qq.com):
set /p sender= 发送邮箱地址(如:
cjiabing@qq.com):
set /p recive= 接收邮箱地址(如:
cjiabing@qq.com):
set /p pword= 发件邮箱密码(如:123456):
set /p subj= 邮件标题(如:
cjiabing@qq.com):
set /p cont= 邮件内容文本路径:(如:C:\body.txt)
goto :eof
@echo off&setlocal enabledelayedexpansion
title OEInboxtool V4.4(通用版)
:start
echo.
echo.
echo OEInboxtool V4.4(通用版)
echo by cjiabing cmd@xp
echo.
echo.
echo.
echo ※需Outlook Express、base64、blat等第三方工具支持。
echo ※Outlook Express邮箱设置为每隔一分钟检查一次新邮件。
echo ※用另外一个邮箱按照标准程式给Outlook Express发邮件。
echo ※只识别标题,不识别内容,且标题的字数和格式受限。
echo ※如发送标题是“shutdown -s -t 0”将使你电脑自动关机。
echo ※使用须自担责任,禁止用于非法目的和行为。
echo.
echo.
ping /n 5 127.0.1>nul
call :try
set jici=0
:loop
set /a jici+=1
echo.
echo ——开始第“%jici%”轮任——
ping /n ^!timec^! 127.0.1>nul
echo.
call :sub
echo.
IF errorlevel 0 (echo 【第“%jici%”轮任务完成,将重新开始任务,退出请直接关闭】) else (echo no^!^!)
echo.
echo ——————————————————————————————————————
if exist newitems.txt call :bbot
if %jici% lss 13 goto loop
taskkill /f /t /im msimn.exe
ping /n 10 127.0.1>nul
goto start
:try
echo.
if exist "%ProgramFiles%\Outlook Express\msimn.exe" start /min "" "%ProgramFiles%\Outlook Express\msimn.exe"
ping /n 5 127.0.1>nul
echo ……初始检测……
if not exist "%ProgramFiles%\Outlook Express\msimn.exe" echo 对不起,找不到你的Outlook Express程序!&ping /n 5 127.0.1>nul&exit
if not exist base64.exe echo 对不起,找不到你的base64.exe程序!&ping /n 5 127.0.1>nul&exit
if not exist "%USERPROFILE%\Local Settings\Application Data\Identities\{1C7149FB-17FD-4ED9-B46C-B7C800F767FF}\Microsoft\Outlook Express\收件箱.dbx" echo 对不起,找不到Outlook Express的收件箱!&ping /n 5 127.0.1>nul&exit
IF errorlevel 0 echo ……初始检测……ok
goto :eof
:sub
echo.
echo ……1、提取邮件……
if exist newitems.txt type newitems.txt>>Readmessageslog.txt
del 收件箱.dbx,firstinbox.txt,editinbox.txt,subjectr.txt,newitems.txt>nul 2>nul 1>nul
if exist "%ProgramFiles%\Outlook Express\msimn.exe" start /min "" "%ProgramFiles%\Outlook Express\msimn.exe"&ping /n 30 127.0.1>nul
setlocal enabledelayedexpansion
for /l %%a in (1,2,10000) do (
set cmt=%%a
if ^!jici^!==^!cmt^! goto cmt1
)
goto cmt2
:cmt1
taskkill /f /t /im msimn.exe
ping /n 10 127.0.1>nul
move "%USERPROFILE%\Local Settings\Application Data\Identities\{1C7149FB-17FD-4ED9-B46C-B7C800F767FF}\Microsoft\Outlook Express\收件箱.dbx" ^!cd^!
goto cmt3
:cmt2
copy "%USERPROFILE%\Local Settings\Application Data\Identities\{1C7149FB-17FD-4ED9-B46C-B7C800F767FF}\Microsoft\Outlook Express\收件箱.dbx" ^!cd^!
:cmt3
ren %cd%\收件箱.dbx firstinbox.txt
for /f "tokens=*" %%a in ('type firstinbox.txt') do echo %%a>>editinbox.txt
for /f "tokens=2*" %%a in ('findstr /i /b "Subject" editinbox.txt') do echo %%a %%b>>subjectr.txt
del firstinbox.txt,editinbox.txt>nul 2>nul 1>nul
if not exist subjectr.txt echo 收件箱没有邮件 &goto :eof
if exist subjectr.txt %cmail%
cd.>mnewitems.txt
findstr /v "^=?gbk?B?" subjectr.txt>>mnewitems.txt
setlocal enabledelayedexpansion
set numt1=0
findstr "^=?gbk?B?" subjectr.txt>nul 2>nul 1>nul &IF errorlevel 0 echo ……提取邮件……ok &goto gbkb
goto :eof
:gbkb
echo.
echo ……2、邮件解码……
if exist subjectr.txt for /f "tokens=*" %%i in ('findstr "^=?gbk?B?" subjectr.txt') do (
set /a numt1+=1
echo ^!numt1^!>nul
set fjmmd=%%i&echo ^!fjmmd:~8,400^!>subjectrjm1^!numt1^!.txt
base64 -d -i subjectrjm1^!numt1^!.txt -o subjectrjm2^!numt1^!.txt
for /f "tokens=*" %%x in (subjectrjm2^!numt1^!.txt) do echo %%x>>mnewitems.txt
del subjectrjm2^!numt1^!.txt,subjectrjm1^!numt1^!.txt
)
IF errorlevel 0 (echo ……邮件解码……ok &goto old) else (echo no^!^!)
if exist subjectr.txt del subjectr.txt
goto :eof
:old
echo ……3、整理邮件……
setlocal enabledelayedexpansion
cd.>newitems.txt
for /f "delims=" %%a in ('sort mnewitems.txt') do (
set xav=%%a
if not ^!xav^! equ ^!vbm^! echo ^!xav^!>>newitems.txt
set vbm=%%a
)
del mnewitems.txt
IF errorlevel 0 (echo ……整理邮件……ok) else (echo ……整理邮件……no)
goto :eof
:send
echo.
echo ……4、发送邮件……
echo 请事先设置一个文本文件,把信件内容写入,再设置路径。你可以使用txt被动发件,也可以通过命令使用bat发件。
::call "%ProgramFiles%\WinRAR\RAR.exe" a "%userprofile%\桌面\123456.rar" npslist.txt pslist.txt runn.txt runr.txt
cd %cd%
blat -install ^!smtp^! ^!sender^!
blat ^!cont^! -to ^!recive^! -u ^!sender^! -base64 -charset Gb2312 -pw ^!pword^! -subject ^!subj^!
::-attach
IF errorlevel 0 (echo ……发送邮件……ok) else (echo ……no)
echo.
ping /n 5 127.0.1>nul
goto :eof
:bbot
echo @echo off>batbot001.bat
echo echo.>>batbot001.bat
echo echo ……我是执行机器人batbot001……>>batbot001.bat
echo echo.>>batbot001.bat
echo echo —————————————————————————————————————>>batbot001.bat
for /f "tokens=*" %%a in (newitems.txt) do echo %%a>>batbot001.bat
echo ping /n 10 127.0.1^>nul>>batbot001.bat
echo exit>>batbot001.bat
start "" batbot001.bat
ping /n 5 127.0.1>nul
goto :eof
Last edited by cjiabing on 2010-3-13 at 16:40 ]
@echo off&setlocal enabledelayedexpansion
title OE Inbox Monitoring and Subject Extraction Tool
echo.
echo.
echo.
echo OE Inbox Monitoring and Subject Extraction Tool
echo Setting Options
echo by cjiabing cmd@xp
echo.
echo.
echo Time control: Set the time for the program to automatically cycle. The default is 60 (about 2 minutes).
set /p timec= Time Setting:
if defined timec (goto set) else (set timec=60)
:set
echo.&set /p email= Do you want to set automatic email sending? Default is not set. (y/n):
if %email%==y (call :mail) else (set cmail=echo Not sending email)
echo.&echo Execution Program: Add the program to be executed with the program. The default is to execute the inbox instruction batbot001.bat.
set /p Performer= Program Setting:
if defined Performer (goto set1) else (goto set2)
exit
:set1
setlocal enabledelayedexpansion
set rdm=%random%
for /f "skip=49 tokens=*" %%a in ('type %0') do echo %%a>>OETool^!rdm^!.bat
echo start ^"^" batbot001^.bat>>OETool^!rdm^!.bat
echo start ^"^" %Performer%>>OETool^!rdm^!.bat
echo ping ^/n 5 127^.0^.1^>nul>>OETool^!rdm^!.bat
echo goto ^:eof>>OETool^!rdm^!.bat
echo.&echo Exit settings and start executing the program&pause>nul
start "" OETool^!rdm^!.bat&exit
:set2
setlocal enabledelayedexpansion
set rdm=%random%
for /f "skip=49 tokens=*" %%a in ('type %0') do echo %%a>>OETool^!rdm^!.bat
echo start ^"^" batbot001^.bat>>OETool^!rdm^!.bat
echo ping ^/n 5 127^.0^.1^>nul>>OETool^!rdm^!.bat
echo goto ^:eof>>OETool^!rdm^!.bat
echo.&echo Exit settings and start executing the program&pause>nul
start "" OETool^!rdm^!.bat&exit
:mail
set cmail=call :send
echo.&echo Sending Settings: Set the program to automatically send emails. Default is not sent.
set /p smtp= SMTP/POP3 (e.g.: smtp.qq.com):
set /p sender= Sender email address (e.g.:
cjiabing@qq.com):
set /p recive= Receiver email address (e.g.:
cjiabing@qq.com):
set /p pword= Sender email password (e.g.: 123456):
set /p subj= Email subject (e.g.:
cjiabing@qq.com):
set /p cont= Email content text path: (e.g.: C:\body.txt)
goto :eof
@echo off&setlocal enabledelayedexpansion
title OEInboxtool V4.4 (General Version)
:start
echo.
echo.
echo OEInboxtool V4.4 (General Version)
echo by cjiabing cmd@xp
echo.
echo.
echo.
echo ※ Requires support from third-party tools such as Outlook Express, base64, blat, etc.
echo ※ Set Outlook Express mailbox to check for new emails every minute.
echo ※ Send emails to Outlook Express using another mailbox according to the standard procedure.
echo ※ Only recognizes the subject, does not recognize the content, and the subject has limited word count and format.
echo ※ If the subject sent is "shutdown -s -t 0", it will automatically shut down your computer.
echo ※ Use at your own risk, and it is prohibited to use for illegal purposes and behaviors.
echo.
echo.
ping /n 5 127.0.1>nul
call :try
set jici=0
:loop
set /a jici+=1
echo.
echo ——Start the "!jici!th" round of tasks——
ping /n ^!timec^! 127.0.1>nul
echo.
call :sub
echo.
IF errorlevel 0 (echo ) else (echo no^!^!)
echo.
echo ——————————————————————————————————————
if exist newitems.txt call :bbot
if %jici% lss 13 goto loop
taskkill /f /t /im msimn.exe
ping /n 10 127.0.1>nul
goto start
:try
echo.
if exist "%ProgramFiles%\Outlook Express\msimn.exe" start /min "" "%ProgramFiles%\Outlook Express\msimn.exe"
ping /n 5 127.0.1>nul
echo ……Initial detection……
if not exist "%ProgramFiles%\Outlook Express\msimn.exe" echo Sorry, cannot find your Outlook Express program!&ping /n 5 127.0.1>nul&exit
if not exist base64.exe echo Sorry, cannot find your base64.exe program!&ping /n 5 127.0.1>nul&exit
if not exist "%USERPROFILE%\Local Settings\Application Data\Identities\{1C7149FB-17FD-4ED9-B46C-B7C800F767FF}\Microsoft\Outlook Express\Inbox.dbx" echo Sorry, cannot find the Inbox of Outlook Express!&ping /n 5 127.0.1>nul&exit
IF errorlevel 0 echo ……Initial detection……ok
goto :eof
:sub
echo.
echo ……1. Extract emails……
if exist newitems.txt type newitems.txt>>Readmessageslog.txt
del Inbox.dbx,firstinbox.txt,editinbox.txt,subjectr.txt,newitems.txt>nul 2>nul 1>nul
if exist "%ProgramFiles%\Outlook Express\msimn.exe" start /min "" "%ProgramFiles%\Outlook Express\msimn.exe"&ping /n 30 127.0.1>nul
setlocal enabledelayedexpansion
for /l %%a in (1,2,10000) do (
set cmt=%%a
if ^!jici^!==^!cmt^! goto cmt1
)
goto cmt2
:cmt1
taskkill /f /t /im msimn.exe
ping /n 10 127.0.1>nul
move "%USERPROFILE%\Local Settings\Application Data\Identities\{1C7149FB-17FD-4ED9-B46C-B7C800F767FF}\Microsoft\Outlook Express\Inbox.dbx" ^!cd^!
goto cmt3
:cmt2
copy "%USERPROFILE%\Local Settings\Application Data\Identities\{1C7149FB-17FD-4ED9-B46C-B7C800F767FF}\Microsoft\Outlook Express\Inbox.dbx" ^!cd^!
:cmt3
ren %cd%\Inbox.dbx firstinbox.txt
for /f "tokens=*" %%a in ('type firstinbox.txt') do echo %%a>>editinbox.txt
for /f "tokens=2*" %%a in ('findstr /i /b "Subject" editinbox.txt') do echo %%a %%b>>subjectr.txt
del firstinbox.txt,editinbox.txt>nul 2>nul 1>nul
if not exist subjectr.txt echo No emails in the inbox &goto :eof
if exist subjectr.txt %cmail%
cd.>mnewitems.txt
findstr /v "^=?gbk?B?" subjectr.txt>>mnewitems.txt
setlocal enabledelayedexpansion
set numt1=0
findstr "^=?gbk?B?" subjectr.txt>nul 2>nul 1>nul &IF errorlevel 0 echo ……Extract emails……ok &goto gbkb
goto :eof
:gbkb
echo.
echo ……2. Decode emails……
if exist subjectr.txt for /f "tokens=*" %%i in ('findstr "^=?gbk?B?" subjectr.txt') do (
set /a numt1+=1
echo ^!numt1^!>nul
set fjmmd=%%i&echo ^!fjmmd:~8,400^!>subjectrjm1^!numt1^!.txt
base64 -d -i subjectrjm1^!numt1^!.txt -o subjectrjm2^!numt1^!.txt
for /f "tokens=*" %%x in (subjectrjm2^!numt1^!.txt) do echo %%x>>mnewitems.txt
del subjectrjm2^!numt1^!.txt,subjectrjm1^!numt1^!.txt
)
IF errorlevel 0 (echo ……Decode emails……ok &goto old) else (echo no^!^!)
if exist subjectr.txt del subjectr.txt
goto :eof
:old
echo ……3. Organize emails……
setlocal enabledelayedexpansion
cd.>newitems.txt
for /f "delims=" %%a in ('sort mnewitems.txt') do (
set xav=%%a
if not ^!xav^! equ ^!vbm^! echo ^!xav^!>>newitems.txt
set vbm=%%a
)
del mnewitems.txt
IF errorlevel 0 (echo ……Organize emails……ok) else (echo ……Organize emails……no)
goto :eof
:send
echo.
echo ……4. Send emails……
echo Please set up a text file in advance, write the letter content into it, and then set the path. You can use txt passive sending, or use bat sending through commands.
::call "%ProgramFiles%\WinRAR\RAR.exe" a "%userprofile%\Desktop\123456.rar" npslist.txt pslist.txt runn.txt runr.txt
cd %cd%
blat -install ^!smtp^! ^!sender^!
blat ^!cont^! -to ^!recive^! -u ^!sender^! -base64 -charset Gb2312 -pw ^!pword^! -subject ^!subj^!
::-attach
IF errorlevel 0 (echo ……Send emails……ok) else (echo ……no)
echo.
ping /n 5 127.0.1>nul
goto :eof
:bbot
echo @echo off>batbot001.bat
echo echo.>>batbot001.bat
echo echo ……I am the execution robot batbot001……>>batbot001.bat
echo echo.>>batbot001.bat
echo echo —————————————————————————————————————>>batbot001.bat
for /f "tokens=*" %%a in (newitems.txt) do echo %%a>>batbot001.bat
echo ping /n 10 127.0.1^>nul>>batbot001.bat
echo exit>>batbot001.bat
start "" batbot001.bat
ping /n 5 127.0.1>nul
goto :eof
Last edited by cjiabing on 2010-3-13 at 16:40 ]