Is it possible to get the program that is launched based on file t

J

Jason soby

Hi,

I'm trying to get the exe name of the program that is launched when i do

ProcessStartInfo info = new ProcessStartInfo();
info.Verb = "print";
info.FileName = FilePath + FileName + "." + FileType;

Process process = new Process();
process.StartInfo = info;
process.Start();

Now, process.ProcessName will get it, but i need the info BEFORE i start it
so i'm a little stumped now. Is this possible?
 
J

Jeff Johnson

I'm trying to get the exe name of the program that is launched when i do

ProcessStartInfo info = new ProcessStartInfo();
info.Verb = "print";
info.FileName = FilePath + FileName + "." + FileType;

Process process = new Process();
process.StartInfo = info;
process.Start();

Now, process.ProcessName will get it, but i need the info BEFORE i start
it
so i'm a little stumped now. Is this possible?

I don't know if there's anything managed, but there is the FindExecutable()
API function.
 
J

Jason soby

You sir, helped me out so much! THANK YOU. Did you just look on pinvoke.net
or do u have some sort of amazing API knowledge?
 
J

Jeff Johnson

You sir, helped me out so much! THANK YOU. Did you just look on
pinvoke.net
or do u have some sort of amazing API knowledge?

I have to claim API knowledge on this one, in the sense that I was pretty
sure such a function existed and that it would be a shell function, but I
did have to look through a list of shell functions on MSDN before I found
the exact one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top