Sign in to follow this  
Followers 0
NegativeNrG

Read through an ini file?

5 posts in this topic

#1 ·  Posted (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 by NegativeNrG

[size=20]My File Upload[/size]Register at my site and upload.

Share this post


Link to post
Share on other sites



Im don't understand what you want, would you read from an ini file, and execute the file it finds with run? or???

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0