missing command line argument in vb.net console app

  • Thread starter Thread starter cs_hart
  • Start date Start date
C

cs_hart

I invoke my program with three command line arguments, but the 2nd and
3rd get joined. CmdArgs(1) shows
"\\dpserv\users\dp\MEAP2008\deliverables\Order Reports\0806 090357"
05"

Here is the command line. I tried putting the last arg in quotes but
the problem still appears.
C:\Temp\VB Projects\MEAPHeaderSlugger\ConsoleApplication\bin
\ConsoleApplication.exe "0806 090357" "\\dpserv\users\dp
\MEAP2008\deliverables\Order Reports\0806 090357\" 05
 
I get the same result
so i deed try with short command line argument and it work

well maybe it is a problem of size of the arguments
 
System.Environment.CommandLine will give you the command line as the
user typed it.

Some other methods of getting the command line, such as
Environment.GetCommandLineArgs, modify what the user typed. Some of
what it does is documented (removing and modifying backslashes), some
is not (the gluing together of arguments that the user intended to be
separate which you saw). From my experience, the gluing together
seems related to the presence of single and/or double quotes, but it
makes no sense to me.

I now only use System.Environment.CommandLine and do my own parsing.
 
That sure looks like it would do what I want, but I don't have
Environment.CommandLine or any of the other members of the
system.environment class. the only member that shows on autocomplete
is
Environment.SpecialFolder
 
That sure looks like it would do what I want, but I don't have
Environment.CommandLine or any of the other members of the
system.environment class. the only member that shows on autocomplete
is
Environment.SpecialFolder

Does it work if you actually type in CommandLine? It might be a
problem with your Intellisense.
 
Back
Top