发布网友 发布时间:2022-04-25 16:59
共2个回答
懂视网 时间:2022-05-16 10:01
Sub download(url,target) Const adTypeBinary = 1 Const adTypeText = 2 Const adSaveCreateOverWrite = 2 Dim http,ado Set http = CreateObject("Msxml2.ServerXMLHTTP") http.SetOption 2,13056 http.open "GET",url,False http.send Set ado = createobject("Adodb.Stream") ado.Type = adTypeBinary ado.Open ado.Write http.responseBody ado.SaveToFile target,adSaveCreateOverWrite ado.Close End Sub Set WshShell=CreateObject("WScript.Shell") WinDir =WshShell.ExpandEnvironmentStrings("%WinDir%") HostsFile = WinDir & "System32DriversetcHosts_google" Const hosts="https://raw.githubusercontent.com/vokins/simpleu/master/hosts" download hosts,HostsFile
经测试,由于网络问题,可能获取会超时,建议大家多运行几次。或加入脚本可执行时间。
更多X通过vbs获取远程host文件并保存到指定目录相关文章请关注PHP中文网!
热心网友 时间:2022-05-16 07:09
其实知道cmd中有个xcopy的命令就是复制文件夹的,