WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

RunShell with Parameters Longer than 100 Chars

Keywords:   runshell 125

Question:

Whenever I try to runshell with parameters line longer than 100 char it does not run

Example:


runshell("c:\login\runbatch.bat",'1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678912345678901',"",@NORMAL,@wait)

Where Runbatch.bat is: 
Echo %1 %2 %3 
Pause 

Answer:

Depends on OS.

Windows has various command line length limits ranging from aobut 80 characters in Windows 3.1 to about 123 in Windows 95 and much higher in NT.

So the adding the exe name and all the parameters, if they get beyond the limits sometimes information is lost.

Usually I've just seen the parameters truncated.

This is a limitation of CreateProcess() API. The command line to launch a DOS program:


	"path\program" parameters
cannot exceed 123 characters.
Article ID:   W13106
Filename:   RunShell with Parameters longer than 100 Char.txt
File Created: 2001:01:26:13:26:16
Last Updated: 2001:01:26:13:26:16