Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Pass MULTIPLE filenames to a Context Menu Shell Command?

Passing a single filename to a context menu shell command is simple:

[HKEY_CLASSES_ROOT\*\shell\MyProgram\Command]
@="program.exe %1"

But if I select multiple files, program.exe is invoked for each such selected file.

What I would like to do instead is invokeprogram.exe only once, passing to it all the filenames currently selected.

How to do this?

like image 810
WinWin Avatar asked Jun 22 '11 13:06

WinWin


People also ask

How do I send multiple files using shell script?

It supports multiple files. Open shell:sendto with Windows + R or paste it into your explorer address bar. It should redirect you to: Create a shortcut to your program in this folder and you should see it in your explorer right-click menu under Send to Show activity on this post.

How to pass a file name as an argument to shell script?

If you want to pass a file name as an argument to a shell script in Ubuntu 20.04, then depending on your exact need, you can pick any of the following three methods: In this script, we have written the “echo” command for printing a message after the Shebang.

How do I pass multiple files to a single instance?

Create a shortcut to your program in this folder and you should see it in your explorer right-click menu under Send to Show activity on this post. You may want to look at this post, as it says that this isn't really possible to pass multiple files to a single instance and you must rely on some form of IPC (Inter process Communication).

What is the difference between filename and hour in shell script?

In this command, Filename.sh represents the name of that shell script that we want to execute whereas Hour.sh is the name of the file that we wanted to pass on to this shell script. You can replace these file names according to the names of your own shell script files.


2 Answers

You can use Send To for this. It supports multiple files.

In case this website goes offline:

Open shell:sendto with Windows + R or paste it into your explorer address bar. It should redirect you to:

C:\Users\<yourusername>\AppData\Roaming\Microsoft\Windows\SendTo

Create a shortcut to your program in this folder and you should see it in your explorer right-click menu under Send to

like image 156
W4ldi Avatar answered Oct 08 '22 09:10

W4ldi


You may want to look at this post, as it says that this isn't really possible to pass multiple files to a single instance and you must rely on some form of IPC(Inter process Communication).

like image 43
Eternal Learner Avatar answered Oct 08 '22 07:10

Eternal Learner