So in my process of developing basic applications using c# I finally came across where I had a need to run Java.exe from my c# application with target command window hidden.
If this solution can be improved please leave you comments but I guess its pretty much standard using c# libraries so can’t go wrong with that
This is how I did it finally.
[geshi lang=”csharp” nums=”1″ target=”_self” ]
string arg = @" -jar jcgp.jar -user=someone";// just an example this can be anything
string command = "java.exe";
ProcessStartInfo start = new ProcessStartInfo(command, arg);
start.UseShellExecute = false;
start.CreateNoWindow = true; // Important
Important piece of information in above code is start.CreateNoWindow = true, by default this value is false
Read more about it here