- 帖子
- 3
- 积分
- 25
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2010-11-28
|
4楼
发表于 2010-11-28 19:42
| 只看该作者
找到一个类似的VBS可以下载的,但原始的代码是下载EXE文件的,下载自动执行更新的,我要的xdb文件不用执行,可下载最新的XDB文件即可,高手帮手改改
- dtmYesterday = DateAdd("d",-1,Date)
- strYear = DatePart("yyyy",dtmYesterday)
- If DatePart("m",dtmYesterday) < 10 Then
- strMonth = 0 & DatePart("m",dtmYesterday)
- Else
- strMonth = DatePart("m",dtmYesterday)
- End If
- If DatePart("d",dtmYesterday) < 10 Then
- strDay = 0 & DatePart("d",dtmYesterday)
- Else
- strDay = DatePart("d",dtmYesterday)
- End If
-
- strYest = strYear & strMonth & strDay
- Set WshShell = CreateObject("WScript.Shell")
- Set fso = CreateObject("Scripting.FileSystemObject")
- TemporaryFolder=fso.GetSpecialFolder(2)
-
- Set tso = fso.OpenTextFile(TemporaryFolder & "\ftp.txt", 8,true,0)
- tso.writeline "binary"
- tso.writeline "mget /public/english_us_canada/antivirus_definitions/norton_antivirus/xdb/" & strYest & "*.xdb"
- tso.writeline "bye"
-
-
- tso.close
-
- runstr="CMD /K cd /d " & TemporaryFolder & _
- "&ftp -A -i -s:ftp.txt ftp.symantec.com"
-
- WshShell.Run(runstr)
-
- runupdate="CMD /K CD /d "& TemporaryFolder & "\" & strYest & "*-x86.exe" 运行更新?就不用了
- WshShell.Run(runupdate)
-
-
-
- Set f = fso.GetFolder(TemporaryFolder)
- Set fc = f.Files
- For Each f1 in fc
- if instr(f1.name,strYest) and instr(f1.name,"-x86.exe") Then
- Set oExec = WshShell.Exec(TemporaryFolder & "\" & f1.name & " /q")
- Do While oExec.Status = 0
- WScript.Sleep 10
- Loop
- fso.DeleteFile(TemporaryFolder & "\" & f1.name)
- end if
- Next
-
- fso.DeleteFile(TemporaryFolder & "\ftp.txt")
-
- Set WshShell = Nothing
复制代码
[ 本帖最后由 wolf1981 于 2010-11-28 22:16 编辑 ] |
|