@echo off

echo ==================================
echo == Compress Files And Send Mail ==
echo ==================================
echo.
echo.

call :Check "%~1"
echo 1
if not "%TargetPath%"=="" call :SetEnv "%TargetPath%"
goto :eof

:Check
if "%~1"=="" (call :help & goto :eof
)else if "%~1"=="/?" (
call :help & goto :eof
) else (
for /f "tokens=1,* delims=:" %%m in ("%~1") do (
set TargetPath=%%~n
echo %%m
echo %%n
)
goto :eof)
::call :SetEnv %str% & goto :end)

goto :eof

rem 设置所有常量;
:SetEnv
echo SetEnv----------%1
set LOCALPATH=%~1
if not "%LOCALPATH:~-1%"=="\" set LOCALPATH=%LOCALPATH%\
set LOCAL_TEMP="%LOCALPATH%..\TempMail"
md %LOCAL_TEMP%
set CMD_7Z=.\software\7-Zip\7z.exe
set CMD_BLAT=.\software\Blat\blat.exe
set MAIL_SMTP_HOST=xxx.xxx.xxx.xxx
set MAIL_SENDER=wei.x.yi@xxx.com
set MAIL_TO=wei.x.yi@xxx.com,qm785462@xxx.com
set MAIL_BODY=""
set MAIL_HEAD=""
goto :eof

:Help
echo /d:[compress path] & goto :eof
echo use /d parameters set compress all path.
echo The path is folder or file.
echo If the path include spase, then use double quotes in this path.
echo.
echo example:
echo   /d:c:\temp or /d:c:\temp\ or "/d:C:\Program Files\Java"
goto :eof

:end

BatSendMail的更多相关文章

随机推荐

  1. zabbix3.0.4 配置邮件报警

    试验环境: LAMP环境 (LNMP环境已经成功了,为了避免干扰,我另一台LAMP主机) ### 我在做实验之前,作了时间同步,不知道这个有木有影响,一起说一下吧! yum -y install nt ...

  2. win10激活工具---KMSAutoNet

    win10激活工具---KMSAutoNet 1> 2> 3> 4> 5> 6> 8>

  3. 【转】移除HTML5 input在type="number"时的上下小箭头

    在chrome下: input::-webkit-outer-spin-button, input::-webkit-inner-spin-button{     -webkit-appearance ...

  4. MyBatis:2

    转载:http://www.cnblogs.com/xrq730/p/5256221.html 前言 前一篇文章,讲了MyBatis入门,讲到了MyBatis有两个基本的配置文件,一个用来配置环境信息 ...

  5. java并发带返回结果的批量任务执行(CompletionService:Executor + BlockingQueue)

    转载:http://www.it165.net/pro/html/201405/14551.html 一般情况下,我们使用Runnable作为基本的任务表示形式,但是Runnable是一种有很大局限的 ...

  6. snagit12个人爱好

  7. 保姆级教程——Ubuntu16.04 Server下深度学习环境搭建:安装CUDA8.0,cuDNN6.0,Bazel0.5.4,源码编译安装TensorFlow1.4.0(GPU版)

    写在前面 本文叙述了在Ubuntu16.04 Server下安装CUDA8.0,cuDNN6.0以及源码编译安装TensorFlow1.4.0(GPU版)的亲身经历,包括遇到的问题及解决办法,也有一些 ...

  8. python中read()、readline()、readlnes()

    在python中 1.file.read()直接按原样读取文件,它通常用于将文件内容放到一个字符串变量中,如果文件大于可用内存,则不可能实现这种处理,因为原来文件里面是str_class,所以 fil ...

  9. DevExpress WPF入门指南:如何自动或手动添加DXSplashScreen控件

    <DevExpress v17.2 版本更新公开课>点击报名 DevExpress WPF 的 DXSplashScreen 控件在应用加载的时候显示一个启动界面.添加DXSplashSc ...

  10. .Net Entity Framework Core 用 HasColumnType 配置浮点数精度

    一.前言 前段时间用.Net Entity Framework core搭建框架,需要配置浮点数的精度,发现.Net Entity Framework core 并没有HasPrecision方法.在 ...