How to pass multiple files to shell context menu command (Windows Explorer)

You can achieve it with my program called singleinstance (source code). No shell extensions involved.

The main idea is that one instance of my program is launched for each file you select. It checks if another instance of the singleinstance program is running, and uses Inter-Process Communication to notify the existing instance that other files have been selected.

Do not forget to set the option MultiSelectModel=Player, otherwise the number of files will be limited.
Usage:

Usage:

Usage: singleinstance.exe "%1" {command} $files [arguments]

Optional arguments for singleinstance (not passed to command):

--si-timeout {time to wait in msecs}

Sample registry file:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\SystemFileAssociations\.txt\Shell\p4merge]
"MultiSelectModel"="Player"

[HKEY_CLASSES_ROOT\SystemFileAssociations\.txt\Shell\p4merge\Command]
@="\"d:\\singleinstance.exe\" %1 \"C:\\Program Files\\Perforce\\p4merge.exe\" $files --si-timeout 400"

Comments
Write your comment
Nickname:
Nickname*:
Sherdor (2022-03-30 11:55:24)
Bonjour,
Ce site est-il encore actif ?
Justre pour savoir avant de communiquer