制作的脚本文件下载和放大器; Excutue [英] Make Script file Download & Excutue
本文介绍了制作的脚本文件下载和放大器; Excutue的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有任何脚本(VBS,JS,BAT等,等),可以下载并执行一个exe文件?
- 您打开脚本。
- 的脚本下载exe文件
- 然后执行该文件
硬盘驱动器上的
感谢。
解决方案
FSO设置=的CreateObject(Scripting.FileSystemObject的)
设置OUTP = Wscript.Stdout
设置的WshShell =的CreateObject(Wscript.Shell)
设置SHAPP =的CreateObject(Shell.Application)
在错误恢复下一页
设置文件= WScript.CreateObject(Microsoft.XMLHTTP)
File.OpenGET,http://definitionupdates.microsoft.com/download/definitionupdates/safetyscanner/x86/msert.exe:200,假
File.setRequestHeader用户代理,Mozilla的/ 4.0(兼容; MSIE 8.0; Windows NT的6.0;三叉戟/ 4.0; SLCC1; .NET CLR 2.0.50727;媒体中心PC 5.0; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C; .NET4.0E; BCD2000; BCD2000)
File.Send
如果Err.Number的<> 0,则
wscript.echo
wscript.echo错误获取文件
wscript.echo==================
wscript.echo
wscript.echo错误&放大器; Err.Number的&安培; (0X与&十六进制(Err.Number的)及)与& Err.Description它将
wscript.echo源&放大器; err.source
wscript.echo
wscript.echoHTTP错误&放大器; File.Status&安培; 与& File.StatusText
wscript.echo File.getAllResponseHeaders
其他
对错误转到0
设置BS =的CreateObject(的ADODB.Stream)
BS.type = 1
BS.open
BS.Write File.ResponseBody
BS.SaveToFile ShApp.Namespace(安培; H10).self.path&安培; \\ safetyscanner.exe,2
wshshell.RunC:\\用户\\ safetyscanner.exe,1,假
万一
这会下载并运行Microsoft安全扫描程序(Vista的32位)。
is there any script (vbs, js , bat , etc ,etc) that can download and execute a exe file?
- you open script on hard drive.
- the script downloads exe file
- then executes the file
thanks.
解决方案
Set fso = CreateObject("Scripting.FileSystemObject")
Set Outp = Wscript.Stdout
Set wshShell = CreateObject("Wscript.Shell")
Set ShApp = CreateObject("Shell.Application")
On Error Resume Next
Set File = WScript.CreateObject("Microsoft.XMLHTTP")
File.Open "GET", "http://definitionupdates.microsoft.com/download/definitionupdates/safetyscanner/x86/msert.exe:200", False
File.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C; .NET4.0E; BCD2000; BCD2000)"
File.Send
If err.number <> 0 then
wscript.echo ""
wscript.echo "Error getting file"
wscript.echo "=================="
wscript.echo ""
wscript.echo "Error " & err.number & "(0x" & hex(err.number) & ") " & err.description
wscript.echo "Source " & err.source
wscript.echo ""
wscript.echo "HTTP Error " & File.Status & " " & File.StatusText
wscript.echo File.getAllResponseHeaders
else
On Error Goto 0
Set BS = CreateObject("ADODB.Stream")
BS.type = 1
BS.open
BS.Write File.ResponseBody
BS.SaveToFile ShApp.Namespace(&h10).self.path & "\safetyscanner.exe", 2
wshshell.Run "c:\users\safetyscanner.exe", 1, False
End If
This downloads and runs the Microsoft Safety Scanner (for Vista 32 bit).
这篇关于制作的脚本文件下载和放大器; Excutue的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文