nKiNG121 Posted June 3, 2013 Share Posted June 3, 2013 (edited) Hi Guys , I am totally new and I need help..,. I created a simple GUI using Koda and I created two buttons .I added the script into Scite . Now how do I program the buttons . I want button1 to download a file to C:/new/ and the button2 to extract the downloaded zip file in that folder and run the extracted file. How do i do that.I know how to download files using AutoIT but i don't know how to change download directory . It never downloads to my selected directory . But i don't know how to add the command to a button . Pls help Edited June 3, 2013 by nKiNG121 Link to comment Share on other sites More sharing options...
water Posted June 3, 2013 Share Posted June 3, 2013 Welcome to AutoIt and the forum! Can you please post the code you have so far? Makes helping you much easier My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
nKiNG121 Posted June 3, 2013 Author Share Posted June 3, 2013 (edited) #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Downloader", 360, 220, 313, 246) GUISetFont(8, 400, 0, "Myriad Hebrew") $Button1 = GUICtrlCreateButton("Download", 48, 56, 241, 41) $Button2 = GUICtrlCreateButton("Install", 48, 120, 241, 41) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 EndSwitch WEnd Edited June 3, 2013 by nKiNG121 Link to comment Share on other sites More sharing options...
water Posted June 3, 2013 Share Posted June 3, 2013 The help file is your friend Check function GUICtgrlCreateButton. At the end you will find an example. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
nKiNG121 Posted June 3, 2013 Author Share Posted June 3, 2013 Okay thanks,.,. but how do I change the download location to c:/new Link to comment Share on other sites More sharing options...
nKiNG121 Posted June 3, 2013 Author Share Posted June 3, 2013 (edited) #include <GUIConstantsEx.au3> Download() Func Download() Local $Button_1, $Button_2, $msg GUICreate("Downloader", 360, 220, 313, 246) GUISetFont(8, 400, 0, "Myriad Hebrew") Opt("GUICoordMode", 2) $Button1 = GUICtrlCreateButton("Download", 48, 56, 241, 41) $Button2 = GUICtrlCreateButton("Instal", -240, 40,241, 41) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 InetGet("example.com","win32.zip") EndSelect WEnd EndFunc ++++++++++++++++++++++++++++++++++++++++++++++++++++++ This script downloads the file to the desktop but how to change it to C:/New. Also How can I make a progress bar to show download progress and also edit Inetget so that if the file already exists then it shows a message box Edited June 3, 2013 by nKiNG121 Link to comment Share on other sites More sharing options...
TheSaint Posted June 3, 2013 Share Posted June 3, 2013 The example in the Help file for InetGet is pretty clear. Are you using the Helpfile? Are you using SciTE to make using the Help file even easier? Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
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