Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Launch exe with parameters from a file? (http://www.go4expert.com/forums/launch-exe-parameters-file-t25291/)

daveyah2002 18Mar2011 17:13

Launch exe with parameters from a file?
 
Hi,

My first post.
A general query.

I wish to launch an executable from a file associated with the program. However I need to lauch it with a parameter from the file I am double-clicking on.

Double-clicking a file is just telling Windows which program to launch it with but is this an accessible process?

Is this feasible?



Thanks.

shabbir 18Mar2011 18:27

Re: Launch exe with parameters from a file?
 
Yes. Any application like a notepad is associated with the .txt files and this is because Windows sends the file name in parameter which is opened by the application.

daveyah2002 18Mar2011 20:48

Re: Launch exe with parameters from a file?
 
Hi, Thanks for the response - not quite what I am after. I know the file is already associated with the program like Notepad launches when you double click a .txt file as in your example.

I want my application to launch with say a command line parameter so it opens in a specific way. The parameter I want to use it would extract from the file I double-click on. So 2 different files could launch the application in a different mode.

Is this possible?

shabbir 18Mar2011 22:33

Re: Launch exe with parameters from a file?
 
Yes why not.

xpi0t0s 21Mar2011 02:01

Re: Launch exe with parameters from a file?
 
Yes, but what you would have to do is have the program parse that file for the parameter.

Or you could create a new program that parses the file, then launches the first program with the file and the parameter.


All times are GMT +5.5. The time now is 21:37.