Launch exe with parameters from a file?

daveyah2002's Avatar, Join Date: Mar 2011
Newbie Member
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.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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.
0
daveyah2002's Avatar, Join Date: Mar 2011
Newbie Member
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?
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Yes why not.
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
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.