PC Review


Reply
Thread Tools Rate Thread

Console Application and commandline arguments

 
 
Patrick Hill
Guest
Posts: n/a
 
      12th Feb 2007
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



 
Reply With Quote
 
 
 
 
jayeldee
Guest
Posts: n/a
 
      13th Feb 2007
On Feb 12, 3:58 pm, "Patrick Hill" <Patr...@Arrow-Soltions.com> wrote:
>
> 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?

 
Reply With Quote
 
Patrick Hill
Guest
Posts: n/a
 
      15th Feb 2007
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
"jayeldee" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Feb 12, 3:58 pm, "Patrick Hill" <Patr...@Arrow-Soltions.com> wrote:
>>
>> 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?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Commandline arguments idbeholda@gmail.com Anti-Virus 10 13th Jul 2007 10:01 PM
nunit for a console application with arguments Brian Microsoft Dot NET 0 27th May 2004 11:36 PM
To read console arguments from windows application in .net vijay Microsoft C# .NET 2 19th Mar 2004 09:32 AM
Start console application with arguments Robert Wehofer Microsoft ASP .NET 0 10th Nov 2003 12:48 PM
Passing command line arguments to a console application Ed Willis Microsoft VB .NET 2 7th Oct 2003 11:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:54 AM.