标签:bat
@echo off
rem -------------------------------------------------------------------------
rem Action: User need to copy Source file to C:\temp\DTS
rem -------------------------------------------------------------------------
if exist "C:\temp\DTS\*.htm" (goto 0) else (goto 1)
:0
rem -------------------------------------------------------------------------
rem Description
rem -------------------------------------------------------------------------
rem This script sends a mail with the status of DTS Report
rem Script Used for China retail office
rem -------------------------------------------------------------------------
rem Change log
rem -------------------------------------------------------------------------
rem 2013-09-26 Eric Fu Split SO DTS report file as south and north parts
rem -------------------------------------------------------------------------
rem Variable declaration
rem -------------------------------------------------------------------------
set mailfile=.\body.txt
set mailserver=smtp.hm.com
set mailtouser=eric.fu@hm.com
rem -------------------------------------------------------------------------
rem Create the Source TXT from DTS Source Report
rem -------------------------------------------------------------------------
HtoX32c *.htm > Source.txt
rem -------------------------------------------------------------------------
rem Swith files TXT and Excel named Source
rem -------------------------------------------------------------------------
echo Operation Done At %DATE% %time% >> C:\temp\DTS\script.log
cscript.exe //Nologo switch.vbs >> C:\temp\DTS\script.log
echo -----------------
echo Finsh DTS Report
echo -----------------
rem -------------------------------------------------------------------------
rem Report sourth and north
rem -------------------------------------------------------------------------
blat %mailfile% -s "DTS Report Of China" -server %mailserver% -t %mailtouser% -f CNITSupport@hm.com -attach North.log -attach South.log -noh
rem -------------------------------------------------------------------------
rem Clear Up Old Source files
rem -------------------------------------------------------------------------
del /Q /F *.htm
del /Q /F source.txt
del /Q /F South.log
del /Q /F North.log
goto end
:1
echo ------------------
echo HTM files not exit
echo ------------------
echo HTM File Miss At %DATE% %time% >> C:\temp\DTS\script.log
pause
goto end
:end
本文出自 “Eric的心路旅程” 博客,谢绝转载!
标签:bat
原文地址:http://ericfu.blog.51cto.com/416760/1636485