DubGamer87 DubGamer87 - 1 year ago 155
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download