There seems to be some security setting that results in this behaviour (haven't investigated that in detail). Given the extra information in your comment below, I was able to recreate the problem. String error = () Ĭonsole.WriteLine("output>" + (String.IsNullOrEmpty(output) ? "(none)" : output)) Ĭonsole.WriteLine("error>" + (String.IsNullOrEmpty(error) ? "(none)" : error)) Ĭonsole.WriteLine("ExitCode: " + exitCode.ToString(), "ExecuteCommand") Warning: This approach can lead to deadlocks, see Edit #2 ProcessInfo.RedirectStandardOutput = true ProcessInfo.RedirectStandardError = true ProcessInfo = new ProcessStartInfo("cmd.exe", "/c " + command) You could try to dump out the contents of the output and error streams in order to find out what's happening: static void ExecuteCommand(string command)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |