1

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.

1 Answer 1

2
Process.Start("cmd", "/k ipconfig")

you can try this

Sign up to request clarification or add additional context in comments.

3 Comments

This would be a stronger answer if you explain what the /k flag does.
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.
@EricJ. the /k flag runs the command requested but leaves the command and window open instead of closing after the command has run.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.