litlmike Posted April 4, 2006 Share Posted April 4, 2006 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 _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Valuater Posted April 4, 2006 Share Posted April 4, 2006 maybe $Run = FileGetShortName("C:\Program Files\AutoIt3\beta\AutoIt.chm") Run(@ComSpec & " /c " & $Run, "", @SW_HIDE) 8) Link to comment Share on other sites More sharing options...
MHz Posted April 4, 2006 Share Posted April 4, 2006 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 More sharing options...
litlmike Posted April 4, 2006 Author Share Posted April 4, 2006 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)? _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Valuater Posted April 4, 2006 Share Posted April 4, 2006 "@ComSpec" using "cmd.exe"?... yes What is the "/c" for?... to close the cmd window, try /k to keep it open (@SW_HIDE)?... hides the cmd window 8) Link to comment Share on other sites More sharing options...
Valuater Posted April 4, 2006 Share Posted April 4, 2006 this works for the folder also $Temp = FileGetShortName(@MyDocumentsDir & "\Personal\AutoIt") Run(@ComSpec & " /c Start " & $Temp, "", @SW_HIDE) start uses the registered program that is associated to the file/program being opened 8) Link to comment Share on other sites More sharing options...
litlmike Posted April 4, 2006 Author Share Posted April 4, 2006 this works for the folder also $Temp = FileGetShortName(@MyDocumentsDir & "\Personal\AutoIt") Run(@ComSpec & " /c Start " & $Temp, "", @SW_HIDE) start uses the registered program that is associated to the file/program being opened 8) Thanks! That helps a lot! _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
sleek Posted April 4, 2006 Share Posted April 4, 2006 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 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