ghostofdeath Posted September 24, 2008 Posted September 24, 2008 Hey all, I'm trying to create a simple BITS downloader (to those who dont know look for Background Intelligence Transfer Service) I want my Downloader get all URLS that the person ADD create a new .exe file from each link using autoIT compiler (didnt finish my code yet).So basically: Add,create .au3,compile au3.Here's my code: #include <GUIConstantsEx.au3> GUICreate("BITS Downloader v0.1",400,400) GUISetState(@SW_SHOW) $list=GUICtrlCreateList("",5,100,240,200) GUICtrlCreateLabel("ADD to list:",5,5) $bat=GUICtrlCreateButton("Batch'em!",250,100,100) $addurl=GUICtrlCreateButton("Add",260,25,30,20) $edit=GUICtrlCreateInput("",5,25,250,18) While 1 $msg = GUIGetMsg() $read=GUICtrlRead($edit) $urls=GUICtrlRead($list) Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg=$bat $sCmdFile="bitsadmin /transfer myDownloadJob /download /priority high "& $urls & "c:\file.exe" $file=FileOpen("urls.au3",128) For $i=1 To $i FileWriteLine($file, "#include <Process.au3>") FileWriteLine($file, "_RunDOS "& "(bitsadmin /transfer myDownloadJob /download /priority high "& $urls & "c:\file.exe)") FileClose($file) Next Case $msg=$addurl GUICtrlSetData($list,$read) EndSelect WEnd The part of $msg=$bat that I got more problems.. I dont know write a file with " on it,how to take each line of the list and change the filewriteline() (Just started something with for/next but didnt try it) and how to create a new file too for each link on the list. See I'm pretty new coding, don't have much time to study it though. :\ Cheerz, Ghost
martin Posted September 24, 2008 Posted September 24, 2008 Hey all, I'm trying to create a simple BITS downloader (to those who dont know look for Background Intelligence Transfer Service) I want my Downloader get all URLS that the person ADD create a new .exe file from each link using autoIT compiler (didnt finish my code yet).So basically: Add,create .au3,compile au3.Here's my code: #include <GUIConstantsEx.au3> GUICreate("BITS Downloader v0.1",400,400) GUISetState(@SW_SHOW) $list=GUICtrlCreateList("",5,100,240,200) GUICtrlCreateLabel("ADD to list:",5,5) $bat=GUICtrlCreateButton("Batch'em!",250,100,100) $addurl=GUICtrlCreateButton("Add",260,25,30,20) $edit=GUICtrlCreateInput("",5,25,250,18) While 1 $msg = GUIGetMsg() $read=GUICtrlRead($edit) $urls=GUICtrlRead($list) Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg=$bat $sCmdFile="bitsadmin /transfer myDownloadJob /download /priority high "& $urls & "c:\file.exe" $file=FileOpen("urls.au3",128) For $i=1 To $i FileWriteLine($file, "#include <Process.au3>") FileWriteLine($file, "_RunDOS "& "(bitsadmin /transfer myDownloadJob /download /priority high "& $urls & "c:\file.exe)") FileClose($file) Next Case $msg=$addurl GUICtrlSetData($list,$read) EndSelect WEnd The part of $msg=$bat that I got more problems.. I dont know write a file with " on it,how to take each line of the list and change the filewriteline() (Just started something with for/next but didnt try it) and how to create a new file too for each link on the list. See I'm pretty new coding, don't have much time to study it though. :\ Cheerz, GhostThe easy answer is don't create a filename with the url; instead have another input for a reference and use that for the file name. What is the compiled au3 file going to do? Maybe you just need FileCreateShortcut. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
ghostofdeath Posted September 24, 2008 Author Posted September 24, 2008 I want one exe for each downloader.. So each exe will work alone.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now