Windows 10 "send to" and default file association configuration - all users

1

1

I am a developer, and I've just created an application, and my own file type, with an unique extension (let's say it would be .aaa). What I want to do is to add an entry on the "Send to" menu (right-click on the file -> send to) so I could send '.aaa' files to my application, and when I double click a .aaa file, it should open with my app.

I've found out, when trying to solve this, that I could put a shortcut to my app at C:\Users\<yourusername>\AppData\Roaming\Microsoft\Windows\SendTo, however, it would work only for one user. I wonder if there is a registry key I could add/edit for that (for both, "send to" and file association), for all users...

Could you help me with that?

Leonardo Alves Machado

Posted 2016-05-17T20:37:13.853

Reputation: 246

How about putting it into C:\Users\Default\AppData\Roaming\Microsoft\Windows\SendTo – Divin3 – 2016-05-17T22:59:23.907

I tried putting the shortcut there, but the send to was not updated. Should it be updated? Should I restart for changes to take effect when I put a shortcut on send to for the Default user? – Leonardo Alves Machado – 2016-05-18T11:46:39.107

Answers

1

C:\Users\Default will be applied only when a new user is created.

To copy it into every existing users SendTo, you need to write a simple batch script:
copy "<yourfile with path>" %APPDATA%\Microsoft\Windows\SendTo /y

and copy the batch script to: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup


The file association can also be scripted using batch, for example:

ftype txtfile="C:\Program Files (x86)\Notepad++\notepad++.exe" %1

In order not to cause any other problems, you have to find the ftype variable used by your program (in case there is one), in our case for .txt the variable is txtfile.
You can find it in regedit - HKEY_CLASSES_ROOT looking for the file extension (in our case .txt), the variable we need is the data value of the (default) string.

In case there is no value, use the script the following way instead:

ftype txtfile="C:\Program Files (x86)\Notepad++\notepad++.exe" %1
assoc .txt=txtfile

Replace txtfile with any value you'd like.

The only problem with this, is that this batch script has to be ran as an administrator. However this will change the default file association for every user.

Divin3

Posted 2016-05-17T20:37:13.853

Reputation: 1 568

Worked perfectly! Thanks a lot. I would vote you up if I could – Leonardo Alves Machado – 2016-05-19T20:03:17.800

You're welcome. :-) if you have any other questions regarding this topic, feel confident to ask. – Divin3 – 2016-05-19T20:04:48.753

Put quotes around "%1" or else Windows will incorrectly read filenames with spaces. – gmarmstrong – 2018-11-25T16:12:40.663