NegativeNrG Posted September 24, 2005 Share Posted September 24, 2005 (edited) hi all, this is my first post in this forum and i need some help with my script. What i want to do is, i need my program to Read through an ini File Instead of putting Run ("X:\program files") is there any possible way to this?This is my script so far.#include <GUIconstants.au3> ;GUI GuiCreate("X & X loader",150,138) $Label = GUIctrlcreatelabel("please choose a browser!", 10, 10) $X = GUIctrlcreatebutton("firefox", 10, 50, 60, 20) $C = GUIctrlcreatebutton("Koaxia", 80, 50, 50, 20) GUIsetstate() while 1 $msg = GUIgetmsg() select case $msg = $GUI_EVENT_CLOSE exitloop case $msg = $firefox run ("X:\program files") Case $msg = $C run ("X:\program files") Case Else ;;; Endselect WEnd Edited September 24, 2005 by NegativeNrG [size=20]My File Upload[/size]Register at my site and upload. Link to comment Share on other sites More sharing options...
Wb-FreeKill Posted September 24, 2005 Share Posted September 24, 2005 Im don't understand what you want, would you read from an ini file, and execute the file it finds with run? or??? Link to comment Share on other sites More sharing options...
Dickb Posted September 24, 2005 Share Posted September 24, 2005 I don't understand the .ini file remark. If you want to use an ini file then please explain for what. I've looked at your code and corrected it. Compare it with your posted code. Firefox works now. #include <GUIconstants.au3> ;GUI GUICreate("X & X loader", 150, 138) $Label = GUICtrlCreateLabel("please choose a browser!", 10, 10) $X = GUICtrlCreateButton("firefox", 10, 50, 60, 20) $C = GUICtrlCreateButton("Koaxia", 80, 50, 50, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $X Run("C:\Program Files\Mozilla Firefox\firefox.exe") Case $msg = $C Run("X:\program files") Case Else ;;; EndSelect WEnd Link to comment Share on other sites More sharing options...
NegativeNrG Posted September 24, 2005 Author Share Posted September 24, 2005 oh sorry if you dont get me, what i mean is, is dere a way to make it Read from an ini file to execute the browser. Example: in the .ini file it says D:\directory to firefox. and in the Code i put in Read ("ini directory") and it will read the D:\directory to firefox and execute it. [size=20]My File Upload[/size]Register at my site and upload. Link to comment Share on other sites More sharing options...
Dickb Posted September 25, 2005 Share Posted September 25, 2005 Like #include <GUIconstants.au3> ;GUI GUICreate("X & X loader", 150, 138) $Label = GUICtrlCreateLabel("please choose a browser!", 10, 10) $X = GUICtrlCreateButton("firefox", 10, 50, 60, 20) $C = GUICtrlCreateButton("Koaxia", 80, 50, 50, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $X Run(IniRead("My.ini", "Browsers", "Firefox", "")) Case $msg = $C Run("X:\program files") Case Else ;;; EndSelect WEnd 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