DubGamer87
DubGamer87

Reputation: 143

Run multiple lines in the command prompt vb.net

I know how to run cmd in vb.net, by using the Shell "cmd.exe /k <command>command, but how do you execute multiple lines using it, or do you use something else?

Upvotes: 2

Views: 4898

Answers (1)

Visual Vincent
Visual Vincent

Reputation: 18310

CMD commands are separated by the ampersand. For instance:

cmd.exe /k <command 1> & <command 2> & <command 3>

An example .NET solution would be:

Process.Start("cmd.exe", "/k <command 1> & <command 2> & <command 3>")

For more see Microsoft's Command Shell documentation.

Upvotes: 2

Related Questions