How do I start programs from a C# program?
-
Is there any way to start programs from the same folder as your C# program without getting a file not found exception? the only way I can seem to fix it is to put the other files into the root of C:\ and telling the program System.Diagnostics.Process.Start(@"C:\example.exe");. But the problem is I have an installer that puts all the files into "C:\program files\Random Title here". And that folder is what ever the user wants it to be, so I cant make my program predict that so just typeing System.Diagnostics.Process.Start(@"Example.exe"); gives me a file not found Exception unless i tell it to always install it "C:\". Any advice?
Y*Live Long And Prosper*Y
-
Is there any way to start programs from the same folder as your C# program without getting a file not found exception? the only way I can seem to fix it is to put the other files into the root of C:\ and telling the program System.Diagnostics.Process.Start(@"C:\example.exe");. But the problem is I have an installer that puts all the files into "C:\program files\Random Title here". And that folder is what ever the user wants it to be, so I cant make my program predict that so just typeing System.Diagnostics.Process.Start(@"Example.exe"); gives me a file not found Exception unless i tell it to always install it "C:\". Any advice?
Y*Live Long And Prosper*Y
try use , FileInfo Property for a process. and for Exe file , just give the file name only, no need to give .exe. Thanks
Best Regards ----------------- Abhijit Jana "Success is Journey it's not a destination"
-
Is there any way to start programs from the same folder as your C# program without getting a file not found exception? the only way I can seem to fix it is to put the other files into the root of C:\ and telling the program System.Diagnostics.Process.Start(@"C:\example.exe");. But the problem is I have an installer that puts all the files into "C:\program files\Random Title here". And that folder is what ever the user wants it to be, so I cant make my program predict that so just typeing System.Diagnostics.Process.Start(@"Example.exe"); gives me a file not found Exception unless i tell it to always install it "C:\". Any advice?
Y*Live Long And Prosper*Y
-
Is there any way to start programs from the same folder as your C# program without getting a file not found exception? the only way I can seem to fix it is to put the other files into the root of C:\ and telling the program System.Diagnostics.Process.Start(@"C:\example.exe");. But the problem is I have an installer that puts all the files into "C:\program files\Random Title here". And that folder is what ever the user wants it to be, so I cant make my program predict that so just typeing System.Diagnostics.Process.Start(@"Example.exe"); gives me a file not found Exception unless i tell it to always install it "C:\". Any advice?
Y*Live Long And Prosper*Y