I have seen another question like this one, but I can't get it to work. I would like my visual basic program to run the command prompt, and run the command ipconfig. Right now, I am trying Process.Start("C:\WINDOWS\system32\cmd", "ipconfig"), but it only opens the command prompt and doesn't run ipconfig. Any help is appreciated.
Add a comment
|
1 Answer
Process.Start("cmd", "/k ipconfig")
you can try this
3 Comments
Eric J.
This would be a stronger answer if you explain what the /k flag does.
willard
I tried to, but it said that I had to wait a few minutes. I was going to wait, click the check mark, then delete my comment.
Panama Jack
@EricJ. the /k flag runs the command requested but leaves the command and window open instead of closing after the command has run.