As you see, I have taken a step to make the window hidden. But it still appears.
Any trick to make it actually hide and never show, and still run the code?
I first tested your solution, and it worked. I then tested my old solution with the form, but with this added in my class method USBMediaCustomizer.PartitionDisks(line number two taken from your solution):
Process p = new Process();p.StartInfo.CreateNoWindow = true;p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;p.StartInfo.UseShellExecute = true;p.StartInfo.RedirectStandardOutput = true;p.StartInfo.RedirectStandardInput = true;/* .. and so on */
Kraeven: Sorry, I would have awarded you some points for your answer, but I was writing the explanation you see above while you were writing your answer. So I didn't see your answer before I had already accepted the solution.
p.StartInfo.CreateNoWindow
If this doesn't work I would suggest looking into the Win32API.ShowWindow give it the handle to the window and use the constant Win32API.SW_HIDE