I suspect the command line is so long that it is getting
truncated somewhere along the way. How do I find the
current command line size in my Command Prompt windows?
And then how do I adjust it to make it longer?
Windows should really make it much easier and more
intuitive to control such environment settings.
Thanks,
Steve
If you're running Win2k, I believe the command line is limited to 127
characters. Another problem you may have is if your command line executable
is actually a batch file, it might not correctly see more than 9 options.
Verify that it's a traditional exe and not a script ending with BAT or CMD
that you use as the %0 argument.
I would also suggest this as a quick check (it won't work if you an
argument-limited EXE): try writing your entire command line to a file, then
running that as a batch file.
If that doesn't work, post a typical command line and there are a couple of
other possible workarounds to try; I'd want to see it before giving an
example due to the typical issues with special characters that CMD has.
"Steve" <saf...@cominsights.com> wrote in message
news:3dae01c151b7$0efab160$a5e62ecf@tkmsftngxa07...
--
Star Fleet Admiral "Q"
"Q" Continuum
Just somebody who likes to help,
no MVP, MCP, MCSE, etc....
Remove the Obvious from E-Mail to reply directly:
email: doomsdayma...@startrekmail.com
"Steve" <saf...@cominsights.com> wrote in message
news:3dae01c151b7$0efab160$a5e62ecf@tkmsftngxa07...
I didn't want to necessarily say anything about the variable subs without
seeing the actual command line; if he has paths with spacesI there could be
some fallout during recursive substitution and expansion...
--
Star Fleet Admiral "Q"
"Q" Continuum
Just somebody who likes to help,
no MVP, MCP, MCSE, etc....
Remove the Obvious from E-Mail to reply directly:
email: doomsdayma...@startrekmail.com
"A l e x A n g e l o p o u l o s" <first name plus last name and I'm at
hotmail; figure it out> wrote in message
news:#$Vch#lUBHA.1400@tkmsftngp03...
Supposedly you can use ! delimiters instead of % in XP and this will delay
expansion until run time, preventing a whole host of those problems; can't
speak from experience since I haven't worked with it yet.
"A l e x A n g e l o p o u l o s" <first name plus last name and I'm at
hotmail; figure it out> wrote in message
news:OEc0fRoUBHA.1384@tkmsftngp03...
--
Star Fleet Admiral "Q"
"Q" Continuum
Just somebody who likes to help,
no MVP, MCP, MCSE, etc....
Remove the Obvious from E-Mail to reply directly:
email: doomsdayma...@startrekmail.com
"Marty List" <Bill....@sun.com> wrote in message
news:#NUYsxoUBHA.2116@tkmsftngp03...
Whoops - my bad...
That's what happens when you "skip" intermediate versions while comparing
comands...
There *is no* environment setting to be controlled.
Command line length is subject to two factors: the length of the command tail
that the operating system supports passing to applications, and the length of
the command line that the command interpreter supports dealing with in the
first place.
DOS-Windows 95/98 and DOS-Windows ME, being DOS-based, have the same operating
system limits on command tail as DOS does, namely 126 characters. DOS-Windows
users who want longer command tails have no choice but to switch to a better
operating system. Fortunately, this newsgroup is not about DOS-Windows. (-:
Windows NT 4, Windows NT 2000, and Windows NT XP all, according to my
information, have an operating system limit of 32KiB on command tail length.
Long before you hit this limit, however, you will hit the limits imposed by
the various command interpreters. Command interpreters impose draconian
limitations of their own, for no good reason, even though the underlying
operating system is in fact quite generous.
Microsoft's CMD has a hardwired limit on the length of a command line that can
be entered of 2046 characters. So, too, does the CMD from ReactOS. JP
Software's 4NT has a limit of 1023 characters. This limit isn't modifiable in
any of them. (Unless one counts altering the source for the ReactOS CMD and
then recompiling it as "modifiable".)
There's no need for 32-bit command interpreters to have any such line length
limits at all, of course. They are only imposed because the authors of these
command interpreters failed to learn from past experience and used
fixed-length buffers for input handling and processing of command lines. It
is, however, quite possible to write a command interpreter that doesn't use
fixed-length buffers, and thus is limited only by available heap space and the
limits imposed by the underlying operating system. None of Microsoft, JP
Software, or the ReactOS developers have seen fit to do so, though.
This is the DOS-Windows 95/98/ME limit. The Windows NT 4/2000/XP limit is
32KiB.
"Jonathan de Boyne Pollard" <J.deBoyn...@tesco.net> wrote in message
news:3BC84045...@tesco.net...
> There *is no* environment setting to be controlled.
....
"Jonathan de Boyne Pollard" <J.deBoyn...@tesco.net> wrote in message
news:3BC84057...@tesco.net...
Regardless of what the theoretical limit for a command line is, CMD.EXE will
only recognize 259 characters for the program name or first parameter, and
up to 2046 characters for the entire command line.
"Marty List" <Bill....@sun.com> wrote in message
news:ecHk3PNVBHA.1632@tkmsftngp05...
(1) Directly typing a command line followed by enter, no expansions
involved: is it correct to say 259 characters?
(2) A command line which involves some variables being expanded out, such as
in a script - same 259 or would it be the longer 2048 limit?
"Marty List" <Bill....@sun.com> wrote in message
news:ecHk3PNVBHA.1632@tkmsftngp05...
>
Thanks for a very thorough response. Now I suspect that I
am seeing a problem with my command tail, although it
seems to fit in the size parameters you mentioned.
BTW, I don't have this problem at all on my Windows
Professional 2000 workstation. This is a new problem only
on my new Windows Server 2000 machine (a Dell PowerEdge
2500). My Windows Professional 2000 workstation command
line handles my code execution just fine as expected.
Is there a difference in the CMD between Windows 2000
Professional and Windows 2000 Server?
Anyway, for the much more detailed version of what's going
on, I used Microsoft Word to measure the number of
characters as 605 (with spaces included in the count).
The command is actually as follows:
C:\jdk1.3\bin\java.exe -Dserver.name="adminserver" -
Dsun.jws.javachome="C:\jdk1.3" -
Dserver.root="C:\JavaWebServer2.0" -
Duser.keystore="C:\JavaWebServer2.0\keys" -
Dpath="C:\WINNT\system32;C:\WINNT;C:\WINNT\System32
\Wbem;.;C:\jdk1.3\bin;C:\Program Files\Common
Files\Network Associates\VirusScan Engine\4.0.xx\" -
Djavahome="C:\jdk1.3" -Dwindir="C:\WINNT" -
Duser.trusted_CA_certs="C:\JavaWebServer2.0\CAstore" -
Dserver.verbose -Dnojre=true -
Djava.security.policy=file:\\C:\JavaWebServer2.0
\security\jserv.policy -
Djserv.security.manager=com.sun.server.security.ServletSecu
rity12 com.sun.server.ServerProcess
The error I'm receiving at this time is as follows:
Usage: java [-options] class [args...]
(to execute a class)
or java -jar [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath <directories and zip/jar files
separated by ;>
set search path for application classes
and resources
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-showversion print product version and continue
-? -help print this help message
-X print help on non-standard options
This indicates two things:
(1) The Java Virtual Machine (JVM) is being properly
executed as expected from the "C:\jdk1.3\bin\java.exe"
portion of the command line, and
(2) The classname com.sun.server.ServerProcess is not
getting fed as a parameter into the JVM process.
I know this because if the classname was being fed
properly into the JVM, then either the application would
start executing, or else I would see an error. If my
problem was with the CLASSPATH, then the error would look
like:
Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/server/ServerProcess
However, since I'm not seeing that error, but rather I'm
seeing an error that indicates that NO classname is
being "seen" by the JVM, that indicates to me that the
command tail that you mentioned is not working properly.
Are there parameters or other ways to adjust the command
tail? Thanks to everyone who's responded on this subject
so far.
Any help anyone can offer me to get my java.exe process to
see the "com.sun.server.ServerProcess" parameter will be
most helpful to me at this point.
Thanks,
Steve
>.
>
I don't know. It seems unlikely, however.
S> The command is actually as follows:
You need to determine how much of that command tail is reaching the process.
Substitute "ECHO", or "%SystemRoot%\System32\CMD.EXE /C ECHO" for
"C:\jdk1.3\bin\java.exe" and try the command line again.
You will very probably find that the entire line is echoed back, implying that
there is no problem with the command line length whatsoever.
Indeed, you will very probably find that truncation of the command line was
never your problem at all, and that your problem was actually that you had
-Dpath="C:\WINNT\system32;C:\WINNT;C:\WINNT\System32
\Wbem;.;C:\jdk1.3\bin;C:\Program Files\Common
Files\Network Associates\VirusScan Engine\4.0.xx\"
where you should have had
-Dpath="C:\WINNT\system32;C:\WINNT;C:\WINNT\System32
\Wbem;.;C:\jdk1.3\bin;C:\Program Files\Common
Files\Network Associates\VirusScan Engine\4.0.xx"
(-:
2046 characters is the limit that Microsoft's CMD imposes on the size of the
command line that can be entered interactively. The CMD from ReactOS imposes
the same limit. JP Software's 4NT imposes a limit of 1023 characters in
versions prior to version 4, and 2047 characters in version 4 and later.
(This updates what I said previously, by the way.)
AA> (2) A command line which involves some variables being expanded
AA> out, such as in a script - same 259 or would it be the longer
AA> 2048 limit?
The documented limit imposed by JP Software's 4NT on the total length of a
command line after variable, alias, and function expansion is 4095
characters. The corresponding limits for Microsoft's CMD and the ReactOS CMD
are not documented, and I have not performed any experiments to determine
them.
The limits on the command name portion of a command line are less interesting,
but (as the subject has arisen) here they are anyway: JP Software's 4NT
quietly truncates the command name portion of a command line when it exceeds
260 characters. Microsoft's CMD complains with an error message unless the
command name portion of a command line is 259 characters or less. The ReactOS
CMD crashes if the command name portion of a command line exceeds 233
characters.