As I suspected having no value, is not the same as having a value.lenghth = 0
To make it work...
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'get command peramiters Dim CommandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Application.CommandLineArgs For i As Integer = 0 To CommandLineArgs.Count - 1 Dim myvariable As String myvariable = (CommandLineArgs(i)) Label1.Text = myvariable.Length 'only used for debug
If myvariable.Length = 0 Then
exit sub End If Next
do somethign else
by exiting the sub I don't need a second conditional statement, and can run the code that the 2nd if statement would have contained.