@echo off
@cd /d %~dp0
:Ver.1.2 JavãpX̐ݒsvɂ
:Ver.1.3 s ΂1.65.1
echo ----------------------------------------------------
echo u΂vϊob`t@C 1.3
echo ----------------------------------------------------
:L̂̎ύXāA_uNbNIłB

:Ot@C̃TCY1000(12Mbyte炢)ɑ₵Ƃ1:폜
:set logsize=10m

:IɃVbg_EHYESȂ炷AȊOȂ炵ȂB
set SHUTDOWN=NO

:[AhXƃpX[hݒ@uEU񋤗L̐ݒς݂Ȃ炻̂܂܂OK
set MAILADDR=doremi@mahodo.co.jp
set PASSWORD=steeki_tabetai

:̍s͖Č\łB
call :default

:ȍ~ALq@(1)1.64ȑOƓ@܂́@Lq@(2)}`ϊs 
:̂ǂ炩gĂBs:̓RgsȂ̂łǂ炩:폜B݂͋Lq(2)

:Lq@(1)
:%CMD% <ID> <ߋO>
:̂悤Ȍ`ŕϊw肵ďĂBߋO͖ĂB
:񉽍sł\łB
:́̂悤IDw肷BߋOgꍇ000000ύX
:%CMD% sm1 000000

:Lq@(2)
:̂܂܂OKBߋO000000ύXB
%CMD% auto?watch_harmful=1 000000 @PUP

:(2)ł́Aɂ͓IDȂ auto.txt ɋLqĂB
:ID1sƂɉsłLq

:̍s͕sƂ\B
:̏ꍇ2sڈȍ~autoauto2Ȃ(auton܂p)ƕύX
:IDXgauto2.txtɂĂBgqȊO̕Ɏw肵܂B

:(1)(2)Ƃ΂{̂̐ݒg܂B

:łB
echo ----------------------------------------------------
echo ׂďI܂B
:Vbg_E
if %SHUTDOWN%==YES shutdown -s -t 30 -c "΂ϊob`t@C"
goto :exit

:default
set local>nul
set log=log.txt
for %%I in (java.exe) do @set java="%%~$PATH:I"
if not %java% == "" goto :javago
:Java8
set jhome=\Program Files\Java\jre8\bin;\Program Files (x86)\Java\jre8\bin;C:\Program Files\Java\jre8\bin;C:\Program Files (x86)\Java\jre8\bin
for %%I in (java.exe) do @set java="%%~$jhome:I"
if not %java% == "" goto :javago
:Java7
set jhome=\Program Files\Java\jre7\bin;\Program Files (x86)\Java\jre7\bin;C:\Program Files\Java\jre7\bin;C:\Program Files (x86)\Java\jre7\bin
for %%I in (java.exe) do @set java="%%~$jhome:I"
if not %java% == "" goto :javago
goto :error
:javago
echo %java%
echo %java% >>%log% 2>>&1
%java% -version
%java% -version >>%log% 2>>&1
set CMD=%java% -jar Saccubus.jar %MAILADDR% %PASSWORD%
exit /b

:error
echo java.exe܂B
echo readmeNew.txtQƂJavaCXg[ăpXݒ肵B
echo.
echo java.exe܂B>>%log%
echo readmeNew.txtQƂJavaCXg[ăpXݒ肵B>>%log%
echo.
:exit
pause
exit

:@΂ Character User Interface@ڍו
:auto.batƂ͈Ⴄgł܂B

:@@{̎g
:@@(1)@@java -jar Saccubus.jar Mail@address.com password ID  ǉIvV
:@@(2)@@java -jar Saccubus.jar Mail@address.com password auto  ǉIvV 
:@@@(2)̏ꍇauto.txtɓIDXgw s\
:@@auto.bat̏ꍇ@%CMD% sm9999 "2009/7/7 7:7"
:@@@͏ȗ\Ȁ݂ꍇ0w

:@AIvVt@C̕ύXi2passGR[h̗j
:@@@ŏ2passp̃IvVt@C1passځA2passڂ2giAXyNg2jpӂ
:@@@1passڃt@C@[PC][4F3].xml@@ [PC][16F9].xml@@@ Ƃ
:@@@2passڃt@C@p2[PC][4F3].xml@p2[PC][16F9].xml@Ƃāip2͕ύX\j
:@@auto.bat̏ꍇ̂悤2sw肷
:@@@%CMD% sm9999
:@@@%CMD% sm9999 0 p2@@@@@(0)͏ȗsAp2̓IvVt@C̐ړ

:@Bݒ(saccubus.xml)̃I[o[Ch
:@@w@@key=I[o[Chl
:@@@ݒlȂꍇ=ŏIB
:@@I[o[Ch\keyipŊJnjsaccubus.xmlQƂĉB
:@@@key̗@<entry key="key">ݒl</entry>ƋLqĂ܂B
:@@@@FontPath@@@@@@tHgt@C̃pXi%WINDIR%\Fonts\msgothic.ttcj
:@@@@FontIndex @@@@@tHgCfbNXi1j
:@@@@SaveVideoFile @@@ۑitruej
:@@@@SaveCommentFile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ily /ST 02:10:00 /TN saccubus /TR C:\saccubus\saccubus\auto.bat
