zenden2k / context-menu-launcher

Select multiple files from Windows Explorer menu and launch just one instance of process
Apache License 2.0
97 stars 17 forks source link

I love it. But it's very slow. #7

Open futuremotiondev opened 3 years ago

futuremotiondev commented 3 years ago

Is there a way to make the invoked command execute faster? I have a custom context menu item that simply adds selected files to a new folder. But it takes about half a second for it to complete. Terracopy has an extension that does the same thing but it's nearly instant.

Sorry for being critical, you've done some amazing work.

ge9 commented 1 year ago

Hi, I implemented a more versatile version of this.

https://github.com/ge9/ExecuteCommand-Pipe

It can pass input files to any program through standard input (in UTF-8), so can be used to run any command (in combination with xargs, etc.).
It's implemented using COM (Component Object Model) method, so no interprocess communication (thus much less time lag), and no limitation on path length or number of files.

jackusay commented 1 year ago

it has --si-timeout {time to wait in msecs}. That's why it needs half a second. Change the value you need.

mdnava commented 10 months ago

Hi, I implemented a more versatile version of this.

https://github.com/ge9/ExecuteCommand-Pipe

It can pass input files to any program through standard input (in UTF-8), so can be used to run any command (in combination with xargs, etc.). It's implemented using COM (Component Object Model) method, so no interprocess communication (thus much less time lag), and no limitation on path length or number of files.

It seems to send arguments with line breaks?

ge9 commented 10 months ago

Yes, each path is suffixed by "\n" (LF) and then concatenated.

mdnava commented 10 months ago

Yes, each path is suffixed by "\n" (LF) and then concatenated.

Wouldn't be much more useful to send them as proper args?, like: prog.exe arg1 arg2 arg3 As it works with singleinstance.exe ?..

ge9 commented 10 months ago

I chose this design because Windows has 32767 character command line length limit. Users may run a command on many files at a deep directory. Converting stdin to commandline args is easily done by xargs. But your design also sounds good. I'll work on this. Thank you for the feature request.

mdnava commented 10 months ago

I chose this design because Windows has 32767 character command line length limit. Users may run a command on many files at a deep directory. Converting stdin to commandline args is easily done by xargs. But your design also sounds good. I'll work on this. Thank you for the feature request.

I did not make singleinstance.exe .. But I have been using it for at least 5 years in Windows context menus.. It has been working perfectly, but I've been looking for an option only because there is not proper order of sent files, when the desired outcome would be for the currently selected file to be the first argument.

In your utility, perhaps giving an additional option to send arguments in line would be helpful.