Jump to content

What Can Run Open?


Recommended Posts

I notice when I use Run to open anything but an .exe the script aborts and closes. Does Run only open .exe? What if I want to open a Folder? Or the AutoIt Beta Help File (AutoIt.chm)?

Thanks in Advance.

Func Open_Work_Stuff ()
Run ("C:\Program Files\SciTE\SciTe.exe")
Sleep (3000)
Run ("C:\Program Files\AutoIt3\beta\AutoIt.chm")
Sleep (5000)
Run ("C:\Documents and Settings\[Secret]\My Documents\Personal\AutoIt")
EndFunc
Link to comment
Share on other sites

The name of the executable (EXE, BAT, COM, or PIF) to run.

Func Open_Work_Stuff ()
    Run (@ProgramFilesDir & "\SciTE\SciTe.exe")
    Sleep (3000)
    Run ('HH.exe "' & @ProgramFilesDir & '\AutoIt3\beta\AutoIt.chm"')
    Sleep (5000)
    Run ("Explorer " & @MyDocumentsDir & "\Personal\AutoIt")
EndFunc

To run non executable file, then just run the program that executes them as above.

Link to comment
Share on other sites

maybe

$Run = FileGetShortName("C:\Program Files\AutoIt3\beta\AutoIt.chm")
Run(@ComSpec & " /c " & $Run, "", @SW_HIDE)

8)

Thank you, it did work for the .chm, but not for opening the Folder Directory. So that I can better understand what is going on here, and avoid further posts, would you mind letting me know what is going on in your code?

For instance, is "@ComSpec" using "cmd.exe"? What is the "/c" for? And what are you hiding (@SW_HIDE)?

Link to comment
Share on other sites

The easiest way is to run explorer using your file path as an argument. Here is my code

for opening my Programs Folder:

Run("C:\Windows\Explorer.exe C:\Program Files")

Simply replace the last part in the command above with different file paths.

(Note: leave a space between the explorer command and your file path)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...