GioVit Posted March 4, 2006 Share Posted March 4, 2006 I need to know how can I open a file (with extension .exe, .doc, .txt, .htm, etc) with it's associated program (Excel, Word, Notepad, Internet Explorer, etc) I tried with thisRun(@ComSpec & " /c start " & $file, @SW_SHOW)but it only work witn Internet Explorer.Is there a more generic way to do this? without knowing the program associated to the file I want to open.thanks in advance Link to comment Share on other sites More sharing options...
BigDod Posted March 4, 2006 Share Posted March 4, 2006 I need to know how can I open a file (with extension .exe, .doc, .txt, .htm, etc) with it's associated program (Excel, Word, Notepad, Internet Explorer, etc) I tried with this Run(@ComSpec & " /c start " & $file, @SW_SHOW) but it only work witn Internet Explorer. Is there a more generic way to do this? without knowing the program associated to the file I want to open. thanks in advanceTry _RunDos #include <Process.au3> $rc = _RunDos("start d:\autoit\uptime.au3") Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
GioVit Posted March 4, 2006 Author Share Posted March 4, 2006 Try _RunDos #include <Process.au3> $rc = _RunDos("start d:\autoit\uptime.au3") I Found that the problem is with Directories or filenames that has space in its names, so I can solve the directories problem executing the function FileChangeDir() previously and then excute _RunDos() but I still have problem with filenames that has spaces. I Tried adding quotation but doesn't work: $rc = _RunDos('"start d:\autoit\up time.au3"') Or $rc = _RunDos('start "d:\autoit\up time.au3"') Any suggestion Link to comment Share on other sites More sharing options...
BigDod Posted March 4, 2006 Share Posted March 4, 2006 I Found that the problem is with Directories or filenames that has space in its names, so I can solve the directories problem executing the function FileChangeDir() previously and then excute _RunDos() but I still have problem with filenames that has spaces. I Tried adding quotation but doesn't work: $rc = _RunDos('"start d:\autoit\up time.au3"') Or $rc = _RunDos('start "d:\autoit\up time.au3"') Any suggestionTry #include <Process.au3> $prog = FileGetShortName("d:\autoit\up time.au3") $rc = _RunDos("start " & $prog) Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
GioVit Posted March 4, 2006 Author Share Posted March 4, 2006 Try #include <Process.au3> $prog = FileGetShortName("d:\autoit\up time.au3") $rc = _RunDos("start " & $prog) Many Thanks BigDog, it works now Many thanks also to all the peoples that colaborates in Autoit forum Link to comment Share on other sites More sharing options...
BigDod Posted March 4, 2006 Share Posted March 4, 2006 Many Thanks BigDog, it works nowMany thanks also to all the peoples that colaborates in Autoit forumThe name is BigDod not BigDog but we all make typos. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
GioVit Posted March 4, 2006 Author Share Posted March 4, 2006 The name is BigDod not BigDog but we all make typos.I'm really sorry but you are Big (Great) anyway! 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