Console Application and commandline arguments

P

Patrick Hill

Hi, I have a console application that takes command line arguments. Now it
seems my program fails if the total number of characters of the input
parameters is greater then 102 anyone know why and how to work around this?
Example:
This will run:
compareitconsole.exe
nemesis,arrowhhs.3.x.tip,\\nemesis\C$\arrowhhsscriptsfromsourcecontrol\3.x.tip\sql\,C:\FO\Pat45678.txt
Total Number of characters: 102

This will not run
compareitconsole.exe
nemesis,arrowhhs.3.x.tip,\\nemesis\C$\arrowhhsscriptsfromsourcecontrol\3.x.tip\sql\,C:\FO\Pat456789.txt

Total Number of characters: 103

Is this just a limitation? is there a way to pass in more then 102
characters?
Thanks
Patrick
 
J

jayeldee

Is this just a limitation? is there a way to pass in more then 102
characters?
Thanks
Patrick

Are you using cmd.exe to execute this? I may be wrong, but I think
the limitation is with cmd.exe rather than the Console Application.
You should be able to test by going into the Debug section of your
Project Properties and pasting in a string of > 102 length into the
Command Line Arguments box.

If this is the case, then the first thing I'd suggest as a possible
workaround is to put the longer path names in an app.config file and
edit them there.

Also, when you say it does not run, are you given an error message of
any sort from Windows?
 
P

Patrick Hill

I'm using command. start -> run -> command
when I say it doesn't run I mean this.
In my main sub the FIRST line I messagebox a value. This works fine when
the string is 102 characters or less.
if the string is longer and I run the program main doesn't run at all (no
messagebox) and I just get a new C:\ prompt
 

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