Search code examples
c#cmdprocess.startcontrolbox

Hide controlbox on Process.Start() cmd window


I am using process.Start(); to start a batch file. The CMD windows appears fine and works perfectly. How can I disable the controlbox (minimize, maximize, close) on the upper right of the cmd window progmatically. I wish for the CMD window to be displayed, but prevent the user from closing it using the X button.

Thanks!


Solution

  • Look here:How to disable the Close button on the title bar of a console application...

    It applies to any console (even the one opened with process.Start();).It's complicated but I think it's the only method available.