用VB脚本实现
1.下载文件
2.建立计划任务
3.检查计划任务是否建立成功
'建立文件夹
dim fPath
dim returnCode
returnCode="200:ok"
fPath = "D:/WebHostingAdmin/defaultweb/CheckWeb/"
CreateFolder(fPath)
'下载需要的文件
Set xPost = CreateObject("Microsoft.XMLHTTP")
xPost.Open "GET","http://文件地址",0
xPost.Send()
Set sGet = CreateObject("ADODB.Stream")
sGet.Mode = 3
sGet.Type = 1
sGet.Open()
sGet.Write(xPost.responseBody)
sGet.SaveToFile fPath+"CheckNet.exe",2
If Err.number<>0 Then
returnCode="300:匹配文件下载失败"
else
dim atCommend
atCommend="schtasks /create /sc minute /mo 5 /tn ""CheckNet"" /tr "+ fPath + "CheckNet.exe" + " /st 00:00:00 /ed 2100/12/31 /ru ""System""