how do i use c# to run command prompt commands?
Lets say i want to run these commands in a sequence:
cd F:/File/File2/...FileX/
ipconfig
ping google.com
or something like that…Can someone make this method:
void runCommands(String[] commands)
{
//method guts...
}
such that your input is a series of string commands (i.e [“ipconfig”,”ping 192.168.192.168″,”ping google.com”,”nslookup facebook.com”) that should be executed on a single command prompt in the specific sequence in which they are put in the array. Thanks.
You could write command sequence in a bat file and run as below.
Reference