Command-line max size

How can I extend command line max size or run antivirus app with long command line as follows (using CreateProcess function):

E:\PROGRA~1\ANTIVIRUS\ANTIVIRUS.EXE C:\PROGRA~1\BLAH\VIRUS~1.EXE /ARCHIVE /NOBOOT /NOBREAK /NOMEM /PACKED /SILENT /REPORT=C:\PROGRA~1\VIRUSES\REPORT.TXT
iam_dumbAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DaFoxCommented:
Hi.

AFAIK the max size depends on the OS (command line and CreateProcess). CreateProcess() seems to accept more characters (as arguments) than command.
You can't increase the sizes!

Maybe someone else knows a little bit more about it?!

Markus
0
iam_dumbAuthor Commented:
Maybe I could use .bat files or something to split that long command line?
0
DaFoxCommented:
Hm, I'm still a little bit confused.

Here's a text from MS about it, but it applies to MS-DOS and Win95 ;-) Won't help that much, I guess.

Can you tell me what happens if you use a component like TDosCommand ( http://maxxdelphisite.free.fr/doscmd.htm ) and execute your long command line in it?

I just read that CreateProcess has a 126 characters limit?!?!

Markus
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

geobulCommented:
Hi,

Your command line works fine using ShellExecute. MAX_PATH global constant is 260 in my Delphi 5 (Windows.pas).

Regards, Geo
0
geobulCommented:
CreateProcess with 235 character long lpApplicationName and lpCommandLine = nil runs fine on my computer.

Regards, Geo
0
iam_dumbAuthor Commented:
I'm confused. It works perfect with other apps (they accept commandline up to 260), but doesn't work with that app (it accept only 126) :(

Anyway, I'm going to accept DaFox answers

... and thanks for cool component!

Regards
Alex
0
geobulCommented:
This short file name looks suspicious to me:

VIRUS~1.EXE

One character is missing I think!

Regards, Geo
0
iam_dumbAuthor Commented:
it's a fake filename.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.