(C# PROGRAMMING) HELP WITH THIS CODE!

  • Thread starter Thread starter XabiPlayerPRO
  • Start date Start date
  • Views Views 1,013
  • Replies Replies 1
X

XabiPlayerPRO

Guest
I´m trying to open a file with an specific program from my program. I mean, I have a non-formatted file and I want to open it with WinRAR (it´s an example), but it only lets me to open the file and doesn´t let me to specify the program (in this case, WinRAR). Anybody can help me?
 
As far as i'm aware, the easiest way would be to open the new process and make it open the file you want by passing the args to the new process as arguments. That is if the target app has functionality to open from CLI arguments. In which case you can specify the parameters when starting the process from within your app.

The args of course would be the same as if you were running the target app from command prompt

Something like
Code:
Process p = new Process();
p.StartInfo.FileName = App_To_Start;
p.StartInfo.Arguments = Your_Args_Here;
p.Start();
 

Site & Scene News

Popular threads in this forum