Jump to content
Sign in to follow this  
Khautekier

Running a script when doubleclick a file in windows explorer

Recommended Posts

Khautekier

Hi all,

i have files on my harddisk with the extension *.evn (event-lists)

i have written code (evn-viewer.aui compiled to evn-viewer.exe) where i can select a evn-file by using FileOpenDialog() and copy the choosen file to a folder renamed as c:\viewer\ file_to_view.evn

after that my autoit code would start a program that reads this file_to_view.evn

This program runs fine but has one shortcoming.

It should be possible to startup my evn-viewer.exe by double clicking an evn-file in the windows explorer (always open this file by evn-viewer.exe.

I can find out the path of the explorer.exe by using _ProcessGetName but i need to know the fullpath of the selected file so i can rename and copy it to the other location.

1. Does anyone know how i can bring up the full path of selected file in a windows explorer.

2. Brilliant would be that i also have a solution to copy the file to the other location if i double click the evn-file in an outlook attachment.

Share this post


Link to post
Share on other sites
MHz

It should be possible to startup my evn-viewer.exe by double clicking an evn-file in the windows explorer (always open this file by evn-viewer.exe.

RunWait('"' & @ComSpec & '" /c assoc .evn=evn-viewer && ftype evn-viewer="path/to/evn-viewer.exe" "%1"', '', @SW_HIDE)

That may help. Fix up the path to your viewer where it says "path/to/evn-viewer.exe".

:rolleyes:

Share this post


Link to post
Share on other sites
Khautekier

Hello herewasplato,

FAQ 16 was the answer to my question.

I did read the FAQ on the main page of the General Help and Support before I post this question but i read the wrong one. I read the ones 'read me first' instead of the FAQ's 'maintained by this-is-me'

Will read both of the FAQs before i post a new question.

Thanks a lot for your help.

Kurt.

Share this post


Link to post
Share on other sites
herewasplato

...but i read the wrong one...

No problem - having two FAQs solves some problems but creates others.

Enjoy AutoIt...


[size="1"][font="Arial"].[u].[/u][/font][/size]

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  

×