BatSendMail

@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

posted on 2013-12-13 17:49  jack_Meng  阅读(379)  评论(0编辑  收藏  举报

导航