DubGamer87 DubGamer87 - 5 months ago 67
Vb.net Question

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?


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.