creating a batch file in c#

Liban picture Liban · Dec 5, 2012 · Viewed 7.2k times · Source

This is my first time creating a batch. basically i want write commands in the command Promt. so i need batch file so that i can it in c# and does the task.

The commands looks like this:

install PortName=COM50-
bcdedit.exe -set TESTSIGNING OFF

How i can create the batch file and run it using c# code.

Thanks

Details: i am using com0com to create virtual ports, so the main idea is to automate the process, so i can create port without going to command port and write the commands.

Answer

Zach Johnson picture Zach Johnson · Dec 5, 2012

Write the commands to a file and call System.Diagnostics.Process.Start() with the path to the file.