Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

program.exe file1 file2 ... file10000 won't work.

Windows have weird limitation to the length of command line parameters. It something between 32683 and 32853 characters. Is there any other way to pass parameters?

share|improve this question
Going to guess the max character limit is 32,767 (max value of a signed 16-bit integer). No idea if there's another way of passing parameters but if you wrote the program, wouldn't it be better to pass the directory name as a parameter instead? – John H Nov 28 '11 at 1:18
@johnh, yes this is proper way of doing it. However, my program.exe doesn't allow dirs. Also, I cannot pass parameters by parts (1-1000 first, 1001-2000 second etc). And more importantly I don't own source code to modify it. – ShyMan Nov 28 '11 at 1:27
What does this program do? Maybe there are alternatives that will work. – MBraedley Nov 28 '11 at 1:36
@ShyMan Yeah we could use some more information here. I really want to suggest using a batch file for this but your comment about being unable to pass the parameters in groups means that's not probably an option. So I guess the question I have is, why can't you pass the parameters in groups? Is it really not possible to collect the output of each group, then grouping that output to create the desired result? – John H Nov 28 '11 at 1:47
Also, how many more files are you wanting to use? – John H Nov 28 '11 at 1:48

The most practical solution is to get your vendor to fix the program.

Failing that, it would be possible (though not easy) to hook the GetCommandLine function so that it returns a string of arbitrary length, although this might just cause the program to crash, depending on how it processes the command line.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .