shellExecuteEx, parameter CHARACTER LENGTH limit?
- Posted by Dan_M Jul 12, 2009
- 932 views
I'm not yet sure if this is also the case with more recent Win32Lib, but in ver 0.60.5, shellExecuteEx will not run a specified program if the TOTAL length of that program's parameters is too long.
For example, if my code is:
scode = shellExecuteEx ( "open", "ex.exe", sprintf("%s %s %s", {aCompareProgram, "\"" & getText(EditText8) & "\"", "\"" & getText(EditText10) & "\"" }), 0,SW_NORMAL , 0)where aCompareProgram is a dos file comparison program,
and the two EditTexts have the results of getOpenFileName,
and those pathfilenames are BOTH LONG,
then the file comparison program will NOT run;
however, if I edit the length of one or both of the pathfilenames down
to just the shorter FILE name, then the file comparison program WILL run.
Because of my systems file structure, a test pathfilename length for the files I was testing is 82 characters, so total length 164 does fail to run.
(Unless I'm misunderstanding something and am somehow wrong?)
(And the reason I sent shellExecuteEx what's in the Edit boxes
is so I could easily shorten the long pathfilenames in testing.)
Dan