Sign in to follow this  
Followers 0
Liibo

Run a default editor (i.e. MS Word for .DOC)

5 posts in this topic

Hallo guys,

I am trying to run default associated program (like MS Word for .DOC files), but I have not found better solution then one below. At command line, I can write command like "Start file.doc" and it run MS Word with this file, I wonder if this could be done (or how, please) in AutoIt?

Thanks for your help.

$prikaz="c:\My Documents\Counters_gd.doc"   ; or something similar to that
if StringRight($prikaz,3)="DOC" Then RunWait(@COMSPEC & ' /C Start winword "' & $prikaz & '"')
If FileExists("c:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe") AND StringRight($prikaz,3)="PDF" Then RunWait(@COMSPEC & ' /C Start "c:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" "' & $prikaz & '"')

Share this post


Link to post
Share on other sites



Do a search for _ShellExecute() and _Run() in the Scripts and Scraps forum. That should give you exactly what you are looking for.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

also try

winword.exe

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@ JSThePatriot - Waw, thank you, it was soo fast - I just added all 200 lines of _ShellExecute function to my script and it works at first try! B)

@ Valuater - Oh yes, of course I've tried that (but it didn't work as expected) :-)

Edited by Liibo

Share this post


Link to post
Share on other sites

@ JSThePatriot - Waw, thank you, it was soo fast - I just added all 200 lines of _ShellExecute function to my script and it works at first try! B)

@ Valuater - Oh yes, of course I've tried that (but it didn't work as expected) :-)

No problemo. Glad to be of service. Valuater was on the right track, just your script would have needed a few more lines. I have written a simple one using the @ComSpec before, but I think the _Run() or _ShellExecute() would be better. I am glad it all worked out for you.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

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