Console Application and commandline arguments

  • Thread starter Thread starter Patrick Hill
  • Start date Start date
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
 
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?
 
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
 
Back
Top