zoukankan      html  css  js  c++  java
  • bat检测文件大小并邮件报警

    rem 获取当前日期
    set TimeName=%date:~0,4%%date:~5,2%%date:~8,2%
    rem 获取文件名
    set file=%TimeName%
     
    rem 获取文件大小
    for %%i in ("D:historysshqdata\%file%") do (
    set indexdx=%%~zi
    )
     
    rem  将文件大小导入到
    echo %file% > body.txt
    echo %indexdx% >> body.txt
     
    :::::::::::::: 发送邮件参数设置::::::::::::::
    set from=xxxxx@163.com    
    set user=xxxxx
    set pass=xxxxx
    set subj=测试
    rem  你要发送的内容,写入文件文件
    set mail=body.txt
    rem  要发送的附件  
    set attach=*.jpg
    set server=smtp.163.com
    set debug=-debug -log blat.log -timestamp
     
    rem  发送邮件命令,需要下载 C:UsersAdministratorDesktopBlat250fulllat.exe %mail% -to %to% -base64 -charset Gb2312 -subject %subj% -attach %attach% -server %server% -f %from% -u %user% -pw %pass% %debug%
    pause
     
    rem 获取当前时间
    set t=%time:~0,2%
     
    rem  判断,并发送邮件报警
    if %t% == 10 (
    if %indexdx% gtr 512000 ( C:UsersAdministratorDesktopBlat250fulllat.exe %mail% -to %to% -base64 -charset Gb2312 -subject %subj% -attach %attach% -server %server% -f %from% -u %user% -pw %pass% %debug%
    pause ) 
    )
     
    if %t% == 14 (
    if %indexdx% gtr 512000 ( C:UsersAdministratorDesktopBlat250fulllat.exe %mail% -to %to% -base64 -charset Gb2312 -subject %subj% -attach %attach% -server %server% -f %from% -u %user% -pw %pass% %debug%
    pause ) 
    )
     
    if %t% == 15 (
    if %indexdx% gtr 512000 ( C:UsersAdministratorDesktopBlat250fulllat.exe %mail% -to %to% -base64 -charset Gb2312 -subject %subj% -attach %attach% -server %server% -f %from% -u %user% -pw %pass% %debug%
    pause ) 
    )
  • 相关阅读:
    js 与 jquery 事件对象 比较(转)
    orcle blob转换
    谷歌浏览器和IE下new Date()注意的一个小地方
    让网页在IE下淡入淡出 共17种效果
    SqlHelper的编写
    最授用的数据库连接语句 ado.net
    .NET C#获取当前网页地址信息
    JS设为首页加入收藏代码大全
    CSS进度条
    Convert.ToInt32()与int.Parse()的区别
  • 原文地址:https://www.cnblogs.com/GXLo/p/5201265.html
Copyright © 2011-2022 走看看