I've built a VB.NET program that contains multiple Forms. Now I want to display a particular Form (not the main/startup form) of the program through the Command Prompt.
For example, if there are two Forms in my program called startup_form and msg_form, I must run codes in CMD such that the program is executed but only msg_form is displayed and startup_form is hidden or not loaded at all.
How do I achieve that?

1 Answer 1


Use command line arguments.

Make your program recognize certain command line switches:

  • myprog.exe /startup
  • myprog.exe /msg

Within your code make it open and display the forms based on what switches are sent via the command line.

Environment.GetCommandLineArgs Method ()

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .