Pass multiple files / folders from windows explorer to external application

可紊 提交于 2019-12-07 07:29:10

问题


Hi does anyone know how to get windows explorer to pass multiple files / folders through to an external app (c#) referenced in the registry?

I am current able to act upon a single file / folder using the %1 syntax but not sure how to get explorer to pass through multiple items.

Does anyone know how to do this?


回答1:


When you select multiple files in Explorer, your shell context menu extension's IShellExtInit::Initialize method will be called and pdtobj contains the selection. Note writing managed shell extension is not supported.




回答2:


I don't think this is possible.

When you open multiple files using Explorer, it will launch a separate copy of your program for file. I don't think it's possible to override this behavior.

EDIT: I forgot about shell extensions. This is possible.

To work around this, you could make the subsequent copies communicate with the first one, then exit. Detailed instructions for this are beyond the scope of this answer.




回答3:


In order to do this reliably you would need to write a shell extension, most likely a sendto implementation.

I haven't written one since vb6 but you can find what looks to be a good managed example here

Or you could use a freeware utility



来源:https://stackoverflow.com/questions/2315990/pass-multiple-files-folders-from-windows-explorer-to-external-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!