zoukankan      html  css  js  c++  java
  • 结合计划任务每天从Symantec官网下载离线病毒库

    #三种方法,由初级到高级

    $numbers
    = 1..40 | Foreach {"{0:D3}" -f $_} #将数字类型格式化并转换为字符串类型使用-f字符串操作符 ForEach ($number in $numbers) { $Source = 'http://definitions.symantec.com/defs/' + ((Get-Date -Format yyyyMMdd) - 1) + '-' + $number + '-v5i32.exe' $Destination = "F:" + ((Get-Date -Format yyyyMMdd) - 1) + "-" + $number + ".exe" Invoke-WebRequest -uri $Source -OutFile $Destination } $webreq = Invoke-WebRequest http://www.symantec.com/security_response/definitions/download/detail.jsp?gid=savce $webreq.Content | Out-File C:output.txt -Force $txt = (Get-Content -Path C:output.txt -TotalCount 924)[-1] $src = $txt.Substring(59,59) $des = "c:" + $txt.Substring(96,22) Invoke-WebRequest -uri $src -OutFile $des $webreq = Invoke-WebRequest http://www.symantec.com/security_response/definitions/download/detail.jsp?gid=savce $gc = $webreq.Content $src = [regex]::Matches("$gc",'http://definitions.symantec.com/defs/.{0,20}.exe') | Foreach-object {$_.value} #正则表达式 $des = "c:" + $src[0].substring(37,22) Invoke-WebRequest -uri $src[0] -OutFile $des
  • 相关阅读:
    命令
    碎片知识
    驱动问题
    网络基础知识普及
    面向设计大作业——公司餐厅
    面向对象--购物车
    OO之接口-DAO模式代码阅读及应用
    有理数类的定义
    图知识点总结
    Java课程设计总结
  • 原文地址:https://www.cnblogs.com/IvanChen/p/4488260.html
Copyright © 2011-2022 走看看