This week someone asked me how they could set their keyboard’s “media key” to open Spotify instead of the default Media Player. Information about this around the web is fragmented and decades old, so I decided to share what I’ve learned here.
Media and app shortcuts are found on many types of keyboards either as dedicated buttons or (often on laptops) as key combinations you can activate together with an FN toggle key, which provide easy access to play and pause media or open specific apps like your browser or calculator.

If your keyboard came with customization software, you should probably close this webpage and use that instead — it’s always a better idea to use the officially supported methods to alter the functionality of your devices. If, however, your keyboard or laptop provides no way to alter the functionality of your media or app shortcut keys, read on to find out how to adjust it directly in the Windows registry.
Registry Location
The settings for the media and application buttons are stored in the registry under the Explorer key. To change the settings computer-wide so it affects all users of the computer (which you’ll need administrator access to the computer to do), you can go to the following registry key. (Registry “folders” are called keys).
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AppKey
To make the change only for your own user account and not impact any other users of the computer, you can go to following registry key instead. Note that the “AppKey” sub-key of Explorer may not exist here by default, but you can create it by right-clicking the Explorer key and choosing New > Key.
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AppKey
Once inside the AppKey key of the registry, look for or create another registry key (“folder”) inside it with a name that matches the key number in the table at the end of this post. It’s inside here you’ll create registry values.
For example, my Calculator button
For examples below we’ll look at re-associating my Calculator key on my Sculpt Ergonomic Desktop Keyboard, which is AppKey 18. I’ve already created an 18 key, which you can see here. When not otherwise defined, the key follows the default action (opening Calculator in this case).

Example One: Associate a button to a file type
One way to modify what the key does is by specifying file type extension as a new string value. From then on, the key will open whatever program is currently associated to the given file type. For example, if I add an association of “.txt”, my calculator button will launch Notepad because Notepad is the default handler for txt files.

Example Two: Associate a button to a command or program name
Another option is to specify a shell command that is executed when the button is pressed. This command can be anything that you can type into your terminal or Run box, including a specific program file name or other command.
I’ve seen at least one user specify the command rundll32.exe user32.dll, LockWorkStation which will lock the workstation (although Windows-L is fine enough for me).

The list of AppKey numbers are below for your reference. It should go without saying that as a undocumented registry change, this functionality could change and stop working at any point, as Microsoft has no obligation to use these specific registry keys in this manner. That being said, these media keyboards have been around for nearly 30 years now and are used by literally billions of people using countless different customization software to do so, so it’s safe to say it’ll stick around for a while in this case.
Key Number | Default Action |
1 | Go Back |
2 | Go Forward |
3 | Refresh |
4 | Stop loading |
5 | Search |
6 | Favorites |
7 | Homepage |
8 | Mute volume |
15 | |
16 | Media |
17 | My Computer / This PC |
18 | Calculator |
24 | Mute microphone |
25 | Lower mic volume |
26 | Raise mic volume |
27 | Help |
28 | Find |
29 | New |
30 | Open |
31 | Close |
32 | Save |
33 | |
34 | Undo |
35 | Redo |
36 | Copy |
37 | Cut |
38 | Paste |
39 | Reply |
40 | Forward (mail) |
41 | Send |
42 | Spell checker |
43 | Toggle dictation |
44 | Toggle microphone |
45 | Corrections |
Leave a Reply