public void Dispose() { if (CommandPrompt != null) { if (StandardOutput != null) { StandardOutput.Dispose(); StandardOutput = null; } if (StandardError != null) { StandardError.Dispose(); StandardError = null; } CommandPrompt.Kill(); CommandPrompt = null; } GC.SuppressFinalize(this); }