Increase limit of commandline length in Win2K?

  • Thread starter msnews.microsoft.com
  • Start date
M

msnews.microsoft.com

I'm trying to concatenate over 1000 pdfs together into one large one.
The util I am using allows me to create my own headings for each pdf as
it is added to the main pdf (better Table of Contents that way). The
problem is, it looks like I might end up having to create 30-50 cmd
files to get it all done, as cmd/command is puking on any command over
about 2K in size.

Is there any way to increase the buffer size for the commandline input?
If so, how, and how large can it go?

Trying to find this info on the MS site or Google has been very painful
so far.
 
R

Ritchie

msnews.microsoft.com said:
I'm trying to concatenate over 1000 pdfs together into one large one.
The util I am using allows me to create my own headings for each pdf as
it is added to the main pdf (better Table of Contents that way). The
problem is, it looks like I might end up having to create 30-50 cmd
files to get it all done, as cmd/command is puking on any command over
about 2K in size.

Is there any way to increase the buffer size for the commandline input?
If so, how, and how large can it go?

No, but you could cmd.exe from Windows XP, but IIRC this will only double
the current limit and take it to around 4K.

Alternatively try Franks RunProcess
http://64.38.67.11:8080/freeware/runprocess.zip
 
W

Walter Briscoe

In message <[email protected]> of Mon, 29 Sep 2003
23:50:11 in microsoft.public.win2000.cmdprompt.admin,
msnews.microsoft.com said:
I'm trying to concatenate over 1000 pdfs together into one large one.
The util I am using allows me to create my own headings for each pdf as
it is added to the main pdf (better Table of Contents that way). The
problem is, it looks like I might end up having to create 30-50 cmd
files to get it all done, as cmd/command is puking on any command over
about 2K in size.

Is there any way to increase the buffer size for the commandline input?
If so, how, and how large can it go?
Probably not if you are using the W2K cmd.exe. Suggestions:
1) The XP cmd.exe is compatible with W2K and has a command line limit of
about 8K;
2) Call the pdf manipulating program (PROG) with the Windows
CreateProcess API. I can think of no reason why that API should have any
limit. YMMV with limits of PROG;
3) Does PROG have the ability to process a file of commands rather than
commands passed directly on the command line?
 
M

msnews.microsoft.com

Walter said:
In message <[email protected]> of Mon, 29 Sep 2003
23:50:11 in microsoft.public.win2000.cmdprompt.admin,


Probably not if you are using the W2K cmd.exe. Suggestions:
1) The XP cmd.exe is compatible with W2K and has a command line limit of
about 8K;

I might need to try this - so I can just copy cmd.exe from an XP system
and run it? That would at least cut the # of .cmd files by a factor of
4. I'd assume I just rename Win2K cmd.exe, copy in the XP version, then
I can doubleclick on a temp.cmd to run it through the "new" XP cmd.exe.
Or would I need to D&D the temp.cmd onto cmd.exe?

2) Call the pdf manipulating program (PROG) with the Windows
CreateProcess API. I can think of no reason why that API should have any
limit. YMMV with limits of PROG;

I don't know the details on this (not a programmer). Is this decently
covered in a help file?
3) Does PROG have the ability to process a file of commands rather than
commands passed directly on the command line?

Unfortunately, no, that's the first thing I tried. The program is pdcat
from pdf-tools.com. Looking over the commandline help, there is no way
to pull from a file.

An example command, temp.cmd:
d:\programme\pdftools\bin\pdcat -I "Foreword"
".\00\foreward\foreword.pdf" -I "Caution" ".\00\foreward\caution4.pdf"
-I "How to Use This Manual" ".\01\212ie\intrinf4.pdf" blah.pdf

This cats the first 3 files into a file blah.pdf, and puts the Foreword,
Caution, etc as bookmarks for the respective section in blah.pdf.

Someone suggested a FOR loop, but I don't know how to possibly make it
work. Not only would I have to feed each sub-file and its' bookmark
heading in, but I'd have to increment the output filename, and then feed
that new filename in on the next run, so that a new subfile could be
added. I'd have to do this because pdcat won't overwrite a current
file. If you ran the above pdcat command twice, it would create
blah.pdf on the first run, but would exit on the 2nd run without doing
anything since blah.pdf already exists.
 
B

BerkHolz, Steven

Will it accept SDTIN?

d:\programme\pdftools\bin\pdcat -I < pdfdata.txt
 
H

Herb Martin

Maybe this is a job best done in Perl instead of struggling with batch?

Good enough excuse to learn Perl (and this is a pretty trivial problem in
Perl so a good place to start.)
 
A

Al Dunbar [MS-MVP]

msnews.microsoft.com said:
I'm trying to concatenate over 1000 pdfs together into one large one.
The util I am using allows me to create my own headings for each pdf as
it is added to the main pdf (better Table of Contents that way). The
problem is, it looks like I might end up having to create 30-50 cmd
files to get it all done, as cmd/command is puking on any command over
about 2K in size.

Is there any way to increase the buffer size for the commandline input?
If so, how, and how large can it go?

I don't understand how breaking your script with the excessively long
commands into 30-50 will make the individual commands any shorter. What do
these long commands look like?

If you are making the commands longer using some technique designed to run
more than one command per line, such as separating commands with "&", you
could break them down into separate commands. These could all live happily
in the same script, as I see no reason to make separate ones.

Alternately, if you feel you are going to have to create a bunch of batch
files that are basically similar to each other (I can understand why that
would be no fun!) why not create a master batch file that creates and
executes these on the fly?

/Al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top