Thank you for the ideas guys, they were very much appreciated. This is a vb.net app. However after further googling and tweaking of the parameters, I achieved the desired result with the following code. I also wanted to incorporate some basic error handling, so as my console program would only ever have 5 command line args and these fields needed to be fixed, I came up with this primitive, but effective solution:
Dim dtext As String = String.Empty
Dim ptext As String = String.Empty
Dim ctext As String = String.Empty
Dim clArgs() As String = Environment.GetCommandLineArgs()
If clArgs.Count() <> 5 Then
Console.WriteLine("Correct usage:""/p plaintext /d dateserial""or")
Console.WriteLine("Correct usage:""/c cyphertext /d dateserial")
End If
If Not (clArgs.Contains("/p") Or clArgs.Contains("/c")) And (clArgs.Contains("/d")) Then
Exit Sub
End If
If clArgs.Contains("/p") And clArgs.Contains("/d") Then
For index As Integer = 1 To 3 Step 2
If clArgs(index) = "/p" Then
ptext = clArgs(index + 1)
dtext = clArgs(index + 3)
Console.WriteLine(ptext)
Console.WriteLine(dtext)
End If
Next
End If
If clArgs.Contains("/c") And clArgs.Contains("/d") Then
For index As Integer = 1 To 3 Step 2
If clArgs(index) = "/c" Then
ctext = clArgs(index + 1)
dtext = clArgs(index + 3)
Console.WriteLine(ctext)
Console.WriteLine(dtext)
End If
Next
End If