Sign in to follow this  
Followers 0
InsiDer

Run .txt extension?

5 posts in this topic

Now I'm probably asking something which is blatantly obvious....oh well -.-

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    Select
        
        Case $msg = $about2item
            $rc = run ("readme.txt")
        Case $msg = $about3item
        $rc = Run ("History.txt")
        Case $msg = $browseitem
            $rc = Run ("Browser.exe")

While the browser.exe works like a charm, the text files won't be executed...what's the alternative to this command?

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

#6

6. Why can I only use Run() to execute .exe files? What about .msi / .txt and others?

Only a few file extensions are usually "runable" - these are .exe, .bat, .com, .pif. Other file types like .txt and .msi are actually executed with another program. When you double click on a "myfile.msi" file what actually happens in the background is that "msiexec.exe myfile.msi" is executed. So to run a .msi file from AutoIt you would do:

RunWait("msiexec myfile.msi")

Or, an even simpler way is to run the command " start" which will automatically work out how to execute the file for you:

RunWait(@COMSPEC & " /c Start myfile.msi")

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

or use ShellExecute if you have the latest beta

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Thank you Valuater, once again your advice has been a valuable guidance for me. I'll be back with more problems later :lmao:

Edited by InsiDer

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