Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 170
  • Last Modified:

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
0
iam_dumb
Asked:
iam_dumb
  • 3
  • 3
  • 3
1 Solution
 
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now