Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Diagnostics;
- namespace Adapters
- {
- public static class Cmd
- {
- /// <summary>
- /// процесс cmd
- /// </summary>
- private static readonly Process cmd = new Process
- {
- StartInfo =
- {
- FileName = "cmd.exe",
- CreateNoWindow = true,
- UseShellExecute = false,
- RedirectStandardInput = true
- }
- };
- /// <summary>
- /// Запускает cmd с аргументами
- /// </summary>
- /// <param name="bath"></param>
- public static void Run(string bath)
- {
- cmd.Start();
- cmd.StandardInput.WriteLine(bath);
- cmd.StandardInput.Flush();
- cmd.StandardInput.Close();
- cmd.WaitForExit();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement