Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have 2 command that is first "nslookup" and second is"ipconfig". How should i combine this two command in one process using c# ?.

What I have tried:

string text = "ipconfig";
string text2 = "nslookup";

string strCmdText;
strCmdText = "/k" + text;
System.Diagnostics.Process.Start("CMD.exe", strCmdText);
Posted
Updated 15-Aug-17 17:48pm

1 solution

The command line would be "cmd /k ipconfig && nslookup".

So, the first parameter of the Process.Start call would be "cmd" and the second would be "/k ipconfig && nslookup".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900