-
Notifications
You must be signed in to change notification settings - Fork 701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug - Menu >> File >> Run for long command line gets truncated #394
Comments
Are you using Winfile 10.2.0.0? If I debug Winfile the args 'leave' winfile via ShellExecute() in shape. |
@ScottHollows I'd second schinagl's question - which release are you using? Also, which version of Windows? I think the limitation is in Unfortunately that doesn't explain:
Originally the code used a different constant for the parameter buffer length compared to the total buffer length, which seems unsafe, but as far as I can tell in this repo they always had the same value. If there was a build where |
@malxau : I hooked up with the debugger, then exactly entered the string specified by @ScottHollows, and was able see that it was fed into ShellExecute() exactly the right way. So @ScottHollows please check MyProgramm.exe if it handles args properly |
I wrote a test program that shows the parameters passed in to it and the length of the parameters It runs ok from a DOS command line with 5000 characters When I run it from File Manager > File Run it gets truncated around 1000 characters, with a bit of wiggle room that is probably the length of the program name I have identified at least one issue where the File Run > Command Line field is limited to 1000 characters so there is no way to test parameters longer than that That 1000 limit is longer than the original 255 that I reported in my original post so must have done that test incorrectly - sorry about that. At a guess, I probably ran an older version of File Manager or I was running it in an virtual machine with an old version of Windows So, my original post was incorrect and the limit is around 1000 rather than the 255 that I reported Since this is under review, can the limit for that Command Line field be increased to maybe 5000 characters ? |
With #340 the length of path and all internal strings was increased to 1024. Thus the arguments of a command passed to File/Run can be 1024 characters. I suggest to use .bat files for arguments longer than 1024 characters, because handling of so many characters in this tiny File/Run box is error prone. |
Thanks for looking into this. I am closing this issue now |
Symptoms
Running a very long command from Menu >> File >> Run results in the command getting truncated somewhere around 255 character and some extra junk characters get added to the command
Example
Menu >> File >> Run
Enter this in the command line field
MyProgram.exe /aaaaaaaaaaaaaaaaaa=aaaaaaaaaaaaaaaaaaaaa /bbbbbbbbbbbbbbbbbbbb=bbbbbbbbbbbbbbbbbbbbbbbbb /cccccccccccccccccc=cccccccccccccccc /ddddddddddddddd=dddddddddddddddd /eeeeeeeeeeeeeeeeeee=eeeeeeeeeeeeeeeeee /ffffffffffffffff=ffffffffffffffffffffff /ggggggggggggggggg=ggggggggggggggggggggggggggg /hhhhhhhhhhhhhhhhhhhhh=hhhhhhhhhhhhhhhhhhh /iiiiiiiiiiiiiiiiiiiiiiii=iiiiiiiiiiiiiiiiiiiiii /jjjjjjjjjjjjjjjjjjjj=jjjjjjjjjjjjjjjjjjjjj /kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk=kkkkkkkkkkkkkkkkkkkkkkkkkk /llllllllllllllllllllll=lllllllllllllllllllll
Press OK
The command gets truncated around 255 characters and junk characters are added to the end
MyProgram.exe /aaaaaaaaaaaaaaaaaa=aaaaaaaaaaaaaaaaaaaaa /bbbbbbbbbbbbbbbbbbbb=bbbbbbbbbbbbbbbbbbbbbbbbb /cccccccccccccccccc=cccccccccccccccc /ddddddddddddddd=dddddddddddddddd /eeeeeeeeeeeeeeeeeee=eeeeeeeeeeeeeeeeee /ffffffffffffffff=fffffffffffffffffffff??? d
Use Case
In my application, the field values can be specified on the command line which can result in a very long command line
Change Request
Please remove the limit or increase it to perhaps 1000 characters
The text was updated successfully, but these errors were encountered: