The reason that your form is closing immediately is because Show returns immediately and then your Main method completes and your app exits. Instead of doing this:
VB Code:
Module StartUp
Sub Main(ByVal args() As String)
Dim frmMain As New frmMain(args(0))
frmMain.Show()
End Sub
End Module
you should have done this:
VB Code:
Module StartUp
Sub Main(ByVal args() As String)
Dim frmMain As New frmMain(args(0))
Application.Run(frmMain)
End Sub
End Module
That's not what you were doing wrong though. You can use that method to retrieve commandline arguments but there are better ways in VB.NET. As you're using a Main method I'm going to assume that you're using VB.NET 2003 (please specify in future). Get rid of that Main method and get rid of that constructor argument.
VB Code:
Dim cla As String() = Environment.GetCommandLineArgs()
If cla.Length > 1 Then
'cla(0) is the executable path.
'cla(1) is the first argument.
End If
Also note for future reference that if you add any constructors to a form they will either need to call InitializeComponent explicitly or else they will need to call the default constructor so that it can call InitializeComponent, i.e. you constructor should have been:
VB Code:
Public Sub New(ByVal path As String)
Me.New()
serverPath = path
End Sub