Skip to content

Instantly share code, notes, and snippets.

@MarshalOfficial
Created January 5, 2021 07:45
Show Gist options
  • Select an option

  • Save MarshalOfficial/f68d4e9cf04578a95dab7e0e78bf0ede to your computer and use it in GitHub Desktop.

Select an option

Save MarshalOfficial/f68d4e9cf04578a95dab7e0e78bf0ede to your computer and use it in GitHub Desktop.
run a cmd command in c#
public static void RunCmd(string command)
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = "app name like bcp";
proc.StartInfo.Arguments = command;
proc.Start();
proc.WaitForExit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment