Return-Path: Received: from BCHydro.bc.ca by milo.bchydro.bc.ca (SMI-8.6/SMI-SVR4) id LAA18262; Mon, 23 Jul 2001 11:37:44 -0700 Received: by BCHydro.bc.ca (SMI-8.6/BCH-5.6.0) id LAA17562; Mon, 23 Jul 2001 11:37:44 -0700 Received: from bchrelay.bchydro.bc.ca by bchgate.bchydro.bc.ca via smap (V2.1) id sma1d017363; Mon, 23 Jul 01 11:37:35 -0700 Received: (from uucp(_at_)localhost) by bchnetgw.bchydro.bc.ca (8.8.8+Sun/8.8.8) id LAA16616 for ; Mon, 23 Jul 2001 11:37:32 -0700 (PDT) Received: from brian.accu.org by bchnetgw via smap (V2.1) id sma1d008045; Mon, 23 Jul 01 11:27:04 -0700 Received: from localhost (majordom(_at_)localhost) by brian.accu.org (8.9.3/8.9.3) with SMTP id TAA46233; Mon, 23 Jul 2001 19:09:01 +0100 (BST) (envelope-from owner-accu-general) Received: by brian.accu.org (bulk_mailer v1.12); Mon, 23 Jul 2001 19:09:01 +0100 Received: (from majordom(_at_)localhost) by brian.accu.org (8.9.3/8.9.3) id TAA46176 for accu-general-outgoing; Mon, 23 Jul 2001 19:04:00 +0100 (BST) (envelope-from owner-accu-general(_at_)accu(_dot_)org) Received: from explorer.zeus.leitch.com (explorer.zeus.leitch.com [204.187.61.195]) by brian.accu.org (8.9.3/8.9.3) with ESMTP id TAA46170 for ; Mon, 23 Jul 2001 19:01:55 +0100 (BST) (envelope-from Jim(_dot_)Hyslop(_at_)Leitch(_dot_)com) Received: (from root(_at_)localhost) by explorer.zeus.leitch.com (8.9.3/8.9.3) id OAA38149; Mon, 23 Jul 2001 14:00:01 -0400 (EDT) Received: from stork.mars.leitch.com (stork.mars.leitch.com [205.210.39.29]) by explorer.zeus.leitch.com (8.9.3/8.9.3) with ESMTP id OAA38146 for ; Mon, 23 Jul 2001 14:00:01 -0400 (EDT) Received: by stork.mars.leitch.com with Internet Mail Service (5.5.2653.19) id <376CJF87>; Mon, 23 Jul 2001 14:01:09 -0400 Message-ID: From: "Jim.Hyslop" To: "'accu-general(_at_)accu(_dot_)org'" Subject: RE: accu-general: Length of command-line parameters? Date: Mon, 23 Jul 2001 14:01:08 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain Sender: owner-accu-general(_at_)accu(_dot_)org Reply-To: accu-general(_at_)accu(_dot_)org Precedence: bulk Content-Length: 1449 Lines: 38 >From "Jim.Hyslop" via accu-general list. Replies will be sent to the list (Reply-to: header set) Colin Paul Gloster wrote: > Does anyone know what the maximum length of a command line parameter can > be? > ... the platform will be strictly Windows, possibly > any flavour (95, 98, 2000, NT). The MSDN documents the command line limit at 127 characters in Windows 95. You can increase this by 250 characters (the maximum under W95) by adding this line to config.sys: shell=c:\windows\command.com /u:250 /p (If the shell command is already there, then simply add the /u: parameter or increase its value). Ah, here's something more concrete - from the MSVC documentation on the _exec function: "The combined length of the inherited environment settings and the strings forming the parameter list for the new process must not exceed 32K bytes. The terminating null character ('\0') for each string is not included in the count, but space characters (inserted automatically to separate the parameters) are counted." Now, I don't know if that's a C library limit, or an OS-imposed limit. Those are about the only documented limits I could find in the MSDN (search key: "maximum command line length"). One way to avoid dependencies on command line length is to put all the information in a file that's read at run-time. -- Jim [ACCU mailing list details, see http://accu.org/mailinglists.htm ]