This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to shell execute a file in C#?
How can i run an execute file in c# (by command line)?
and in addition, I want to save the output and see it on the screen?
See the System.Diagnostics.Process class. See MSDN.
You use the StadardOutput (and optionally StandardError) to get the output and put it at the screen any way you want.
Related
This question already has answers here:
How can I write on another process memory?
(4 answers)
How to remote invoke another process method from C# application
(2 answers)
Closed 3 years ago.
I've been starting to do some decompiling of my C# programs and got some interesting results by editing the dlls, but is it possible to change values and call functions in a running process given that I know what the names of the variables or functions are?
Doesn't any cheat to any game do exactly that?
I mean, if I understand you correctly, there is software called
Cheat Engine which allows you to modify process variables values, inject dll's and much more.
This question already has answers here:
How can run functions of powercfg by C# code?
(3 answers)
Closed 9 years ago.
From my C# program I want to open the power options from the control panel in Windows.
However I can't seem to find out how to do that, I tried making a shortcut and see where it goes but it is referring to the control panel.
Does anyone have an idea how to do that or where the exe is located to launch?
Try the following:
System.Diagnostics.Process.Start("powercfg.cpl");
This question already has answers here:
Auto-update library for .NET? [closed]
(12 answers)
Closed 9 years ago.
I have simple question - is it possible, to replace *.exe file (application file), when it's running? I mean i know that i cannot do that when app is running, but maybe it's possible to do something like:
do application.shutdown()
replace oldExe -> newExe
application.restart().
Create a helper application. You will run this "helper" application when you need it, and it can monitor/replace the main application when it has been closed. Once replaced, the helper application can launch your main application again.
You can also run command line arguments to your helper app, telling it what you need it to do.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Open file with associated application
I want to open a file in it respective application, e.g. open function of windows.
Same thing can be done in java with the help of Desktop class where you pass the file name and the respective file is opened.
But no idea how to do in C#.
System.Diagnostics.Process.Start("filename.doc");
This question already has answers here:
How do I get the list of open file handles by process in C#?
(7 answers)
Closed 7 years ago.
Is there a way to get List of Files or FileName which a Process is writing (if possible writing/reading/appending) ,from C# ,which means im talking about Windows (NT,Vista,XP,7).
see here: How do I get the list of open file handles by process in C#?