Page 1 of 1

Maximum limit to "Open with".

Posted: 24 Oct 2007 13:43
by Gandolf
admin wrote:...As a first example, the Open With commands now give you the following choice:
- Pass all the items to the same instance of the application...
It does not appear to work with more than 47 documents. Is there a maximum? I tried with two different text editors both of which are multi-document capable.

Re: Maximum limit to "Open with".

Posted: 24 Oct 2007 13:46
by admin
Gandolf wrote:
admin wrote:...As a first example, the Open With commands now give you the following choice:
- Pass all the items to the same instance of the application...
It does not appear to work with more than 47 documents. Is there a maximum? I tried with two different text editors both of which are multi-document capable.
I think it depends on the total length of the command line. There's a limit. Was it 2K?

Re: Maximum limit to "Open with".

Posted: 24 Oct 2007 13:56
by Gandolf
admin wrote:I think it depends on the total length of the command line. There's a limit. Was it 2K?
No. XP SP2.
It is command line dependant and another file managers solution is to open a second (or third) instance of the text editor if the command line is too long. I can normally work with about 70 documents before it opens a second instance.

If it has exceeded the limit then a message of some sort would be a good idea since nothing happens, so one is waiting to see if it will open after a delay.

Posted: 24 Oct 2007 14:09
by TheQwerty
From my testing it appears to be the limit is 2047 characters (at least in XP SP2).

The way Windows handles cases when it is too long is to spit back a generic error message. I think XY should probably do the same.

EDIT: One thing that could be done to improve upon this is to attempt to change working directories to something common to all the files and then formulate the call from there. The path to each file would be shorter so you could get more in before the limit. But that would add another layer of complexity to this.

Posted: 24 Oct 2007 14:12
by admin
TheQwerty wrote:From my testing it appears to be the limit is 2047 characters (at least in XP SP2).

The way Windows handles cases when it is too long is to spit back a generic error message. I think XY should probably do the same.

EDIT: One thing that could be done to improve upon this is to attempt to change working directories to something common to all the files and then formulate the call from there. The path to each file would be shorter so you could get more in before the limit. But that would add another layer of complexity to this.
Yes, that's the way to try...

2047 -- yes, that's what I meant by "2K" (not the OS, Gandolf :) ).

Posted: 24 Oct 2007 15:05
by Gandolf
Interesting, I wonder how the other file manager does it since I've just opened 231 documents across multiple paths from it without any problem. I'm surprised TextPad didn't object to having that many documents opened in it, but it didn't, however, displaying stacked tabs did occupy over half the screen!

Posted: 24 Oct 2007 15:17
by TheQwerty
Gandolf wrote:Interesting, I wonder how the other file manager does it since I've just opened 231 documents across multiple paths from it without any problem. I'm surprised TextPad didn't object to having that many documents opened in it, but it didn't, however, displaying stacked tabs did occupy over half the screen!
Well if you had TextPad set to force a single instance and the other file manager made multiple calls it would could do that.

Which file manager is this?

Posted: 25 Oct 2007 08:48
by Gandolf
TheQwerty wrote:...Well if you had TextPad set to force a single instance and the other file manager made multiple calls it would could do that.
So command line length is an irrelevant factor in that situation.
TheQwerty wrote:Which file manager is this?
ZTreeWin.

Posted: 25 Oct 2007 13:25
by TheQwerty
Gandolf wrote:
TheQwerty wrote:...Well if you had TextPad set to force a single instance and the other file manager made multiple calls it would could do that.
So command line length is an irrelevant factor in that situation.
It is for the most part. If you're using TextPad in single instance mode it probably makes more sense to have XY use multiple calls.

Gandolf wrote:
TheQwerty wrote:Which file manager is this?
ZTreeWin.
I tried to look into how they handle it, but I can't seem to figure out how to even use it. :oops:

Re: Maximum limit to "Open with".

Posted: 19 Nov 2007 06:28
by Gandolf
admin wrote:...I think it depends on the total length of the command line. There's a limit. Was it 2K?
This might interest you if you want to pursue longer command lines:

http://support.microsoft.com/kb/830473

Two little extracts:
"On computers running Microsoft Windows XP or later, the maximum length of the string that you can use at the command prompt is 8191 characters. On computers running Microsoft Windows 2000 or Windows NT 4.0, the maximum length of the string that you can use at the command prompt is 2047 characters."

However, I suspect this is how the programs I use work with longer command lines since I know that they create a temporary list file:
"Modify programs that require long command lines so that they use a file that contains the parameter information, and then include the name of the file in the command line."

Re: Maximum limit to "Open with".

Posted: 19 Nov 2007 08:34
by admin
Gandolf wrote:
admin wrote:...I think it depends on the total length of the command line. There's a limit. Was it 2K?
This might interest you if you want to pursue longer command lines:

http://support.microsoft.com/kb/830473

Two little extracts:
"On computers running Microsoft Windows XP or later, the maximum length of the string that you can use at the command prompt is 8191 characters. On computers running Microsoft Windows 2000 or Windows NT 4.0, the maximum length of the string that you can use at the command prompt is 2047 characters."
Yes, I know, but at least one user here reported that 2047 is the maximum under XP. (I think) I tried it myself it also found 2047 to be the limit.
Gandolf wrote:However, I suspect this is how the programs I use work with longer command lines since I know that they create a temporary list file:
"Modify programs that require long command lines so that they use a file that contains the parameter information, and then include the name of the file in the command line."
Yep, I plan to go this way with some future feature I have in mind.

Re: Maximum limit to "Open with".

Posted: 19 Nov 2007 10:14
by Gandolf
admin wrote:...Yes, I know, but at least one user here reported that 2047 is the maximum under XP. (I think) I tried it myself it also found 2047 to be the limit....
Ctrl+Alt+P then paste in a line of 3238 characters:

"C:\C:\Program Files\UltraEdit\uedit32.exe" "C:\Downloads\November\01\Info [01].txt" ...... "C:\Downloads\September\30\Info [30].txt"

and hit enter. No problem.

So it's certainly more than 2047.

Re: Maximum limit to "Open with".

Posted: 19 Nov 2007 11:05
by admin
Gandolf wrote:
admin wrote:...Yes, I know, but at least one user here reported that 2047 is the maximum under XP. (I think) I tried it myself it also found 2047 to be the limit....
Ctrl+Alt+P then paste in a line of 3238 characters:

"C:\C:\Program Files\UltraEdit\uedit32.exe" "C:\Downloads\November\01\Info [01].txt" ...... "C:\Downloads\September\30\Info [30].txt"

and hit enter. No problem.

So it's certainly more than 2047.
I tried it with photoshop and uedit: my limit is 2047. This might be actually a limit of the shellexecute api by which I call the apps. Could not find any documentation.