Iam trying to run a .exe file with argument from unity using C#, this is what I came up with so far;
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
process.StartInfo.FileName = "C://PATH//ABC.exe";
process.StartInfo.Arguments = "ARGUMENT";
process.Start();
process.WaitForExit();
The argument should create a text file, but nothing is happening.
And this error keeps on showing up :
NullReferenceException: Object reference not set to an instance of an object
System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo,
System.Diagnostics.Process process) System.Diagnostics.Process.Start ()
(wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
Can anyone tell me why is the text file not creating, and how can I fix this error?