Reputation: 457
I would like to run a batch command in c# code.
I tried this code but it only pops up cmd but I want it to pop up cmd and displays "Hello World".
Process.Start("cmd", "echo Hello World");
Is it possible to do this?
Upvotes: 1
Views: 318
Reputation: 8551
Try this:
Process.Start("cmd", "/K echo Hello World");
(Note the "/K")
based on this reference for cmd.exe
Upvotes: 5