Windows 10: associate a command to "all" files

0

In windows machines, I need add a "right mouse" option to "all" data files (in concrete, all image formats and text files with extension .txt or .html, but add it to all files is also acceptable ).

This new option must execute a "curl" command. Curl is an existing installed package, the sentence to be execute is something as:

c:\Program Files\curl.exe -X "file=@myfile" http://foo.com

where "myfile" must be replaced by the path of the file selected with the right mouse action (real sentence is a few longer).

It is something similar to the option "compress" that appears when a zip/unzip software is installed. This new option must not suppress current file associations.

Any hint ?

Thanks.

pasaba por aqui

Posted 2018-11-30T11:51:32.913

Reputation: 131

You need to edit the registry for this. But its pretty dangarous to do this, and I wonder if I would do you a favor with this, because it can go wrong enough to require a reinstall. – LPChip – 2018-11-30T14:52:33.030

@LPChip: Thanks for your interest in the issue. No problem with regedit. About risks, in worst case reformat and reinstall is a sane practice to empty disk space. – pasaba por aqui – 2018-11-30T15:15:11.157

Answers

1

This should be pretty close:

[HKEY_CLASSES_ROOT\*\shell\postme\command]
@="\"c:\Program Files\curl.exe\" -X \"file=@%1\" https://example.com/"

You'll need to import that to the registry (or add the default option that equates to the value there) then restart Explorer and it should be available for you as "postme".

shawn

Posted 2018-11-30T11:51:32.913

Reputation: 612