Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
3  
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
1  
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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.