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?

2
  • How about putting it into C:\Users\Default\AppData\Roaming\Microsoft\Windows\SendTo
    – Divin3
    May 17, 2016 at 22:59
  • 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? May 18, 2016 at 11:46

1 Answer 1

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.

3
  • Worked perfectly! Thanks a lot. I would vote you up if I could May 19, 2016 at 20:03
  • You're welcome. :-) if you have any other questions regarding this topic, feel confident to ask.
    – Divin3
    May 19, 2016 at 20:04
  • Put quotes around "%1" or else Windows will incorrectly read filenames with spaces. Nov 25, 2018 at 16:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .