28 lines
727 B
C#

using System;
using System.Diagnostics;
namespace MontoyaTech.Process.Net.Example
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Starting process");
var startInfo = new ProcessStartInfo()
{
FileName = "cmd.exe",
RedirectStandardInput = true,
};
var process = WinProcess.Start(startInfo, creationFlags: WinProcess.CreationFlags.CREATE_NEW_CONSOLE);
process.StandardInput.WriteLine("This is a test");
process.StandardInput.WriteLine("Does this work?");
Console.WriteLine("Done.");
Console.ReadLine();
}
}
}