missing command line argument in vb.net console app

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
 
G

Gillard

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
 
J

Jack Jackson

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.
 
C

cs_hart

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
 
J

Jack Jackson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top