Link to home
Start Free TrialLog in
Avatar of meehanj
meehanj

asked on

Command Line Overflow

All,

The project I'm working on (Win NT 4.0 SP3, VC++ 5.0) has for various reasons, a need to spawn a separate program from within our own.
When we spawn the program we get a command line overflow at about the 150th character. 150 characters sounds like a lot until you start referring to multiple files with their full path.

Unfortunately, we can't just wrap the spawned program's inputs into a file, because it's 3rd party.
We thought about kludging a hack were we put everything in the same directory temporarily, but aren't really satisfied with that.

So,
a) Can we increase the command line length? (and How?)
b) Can we avoid the command line length issue altogether (without using argument files)?
c) What is the actual command line length (154 seems like a very strange number for it to be...)?

Thanks in advance for any help you can give...

meehanj
Avatar of jpk041897
jpk041897

Actualy the max command line length for DOS IS 154 characters and it affect Win95 and NT also.

You cannot easily increase the 154 character limit, I.e: without overriding command.com entierly. There are a few shareware programs like 4DOS (which you can download at http://www.shareware,com) that increase this size to 255 characters.

But even with this increase, if at all possible, your best workarrounds are usualy to dinamically change directoris to the intended PATH and then open the file.

Avatar of meehanj

ASKER

Continuing :
Would ShellExecute() instead of spawn*() gain us anything?
ASKER CERTIFIED SOLUTION
Avatar of footloose
footloose

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial