Command Line Arguments are Space Delimited.
If you need to pass an argument such as a filename that has (or may have) spaces you can enclose it in double quotes.
The exception to this is when arguments end with \
in which case you have to escape this with another \
So in your case this is what you need:
d:\littleProgram.exe "d:\test 2\folder\\" "test.pdf"
So your code would look like this:
For i As Integer = 0 To My.Application.CommandLineArgs.Count - 1
Debug.Writeline(My.Application.CommandLineArgs(i))
Next
Output:
d:\test 2\folder\
test.pdf
A simpler approach might be to remove the trailing slash and add the directory and filename together using Path.Combine
or just pass the fully qualified name as the argument (enclosed in double quotes)