Running a(ny) shell command using C#





0/5 (0 vote)
Something I only found out about recently:There's a better alternative than using "cmd start...".One should use the following method:[System.Runtime.InteropServices.DllImport("shell32. dll")]private static extern long ShellExecute(Int32 hWnd, string lpOperation,string lpFile, string...
Something I only found out about recently:
There's a better alternative than using "
cmd start...
".
One should use the following method:
[System.Runtime.InteropServices.DllImport("shell32. dll")]
private static extern long ShellExecute(Int32 hWnd, string lpOperation,
string lpFile, string lpParameters, string lpDirectory, long nShowCmd);
This method is used according to what's written
here[^].
If it helps, there's a guy who gave a good example of the usage (although it's written in C) in here[^].