码迷,mamicode.com
首页 > 其他好文 > 详细

[实战4]DTS Report /main code/

时间:2015-04-21 14:48:44      阅读:157      评论:0      收藏:0      [点我收藏+]

标签: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的心路旅程” 博客,谢绝转载!

[实战4]DTS Report /main code/

标签:bat

原文地址:http://ericfu.blog.51cto.com/416760/1636485

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!