- 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
复制代码