?
Solved

Command-line max size

Posted on 2003-03-14
9
Medium Priority
?
156 Views
Last Modified: 2010-05-18
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
Comment
Question by:iam_dumb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
9 Comments
 
LVL 6

Expert Comment

by:DaFox
ID: 8135096
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
 

Author Comment

by:iam_dumb
ID: 8135122
Maybe I could use .bat files or something to split that long command line?
0
 
LVL 6

Accepted Solution

by:
DaFox earned 500 total points
ID: 8135245
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 17

Expert Comment

by:geobul
ID: 8135534
Hi,

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

Regards, Geo
0
 
LVL 17

Expert Comment

by:geobul
ID: 8135593
CreateProcess with 235 character long lpApplicationName and lpCommandLine = nil runs fine on my computer.

Regards, Geo
0
 

Author Comment

by:iam_dumb
ID: 8135686
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
 
LVL 17

Expert Comment

by:geobul
ID: 8135768
This short file name looks suspicious to me:

VIRUS~1.EXE

One character is missing I think!

Regards, Geo
0
 

Author Comment

by:iam_dumb
ID: 8135902
it's a fake filename.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question