I’m trying to gain more control over the behavior of Windows 10 UWP when I click on a link structured as a URI with a protocol like twitter://. Specifically, when I click on a link such as: twitter://realDonaldTrump/status/266259787405225984, Windows tries to open it with an app.
However, I would like to have the option to copy the URI to my clipboard instead. Is there a way to add a “Copy URI to clipboard” button to the “Open With” dialogue box, as seen in the image below?
3 Answers
Add a “Copy URI to clipboard” option to the “Open With” prompt in Windows 10
Windows 10 is the latest version of the Windows operating system, and it comes with a lot of features that make it one of the best operating systems in the world. One of the features of Windows 10 is the ability to open links structured as a URI with a protocol like twitter://. However, some users may want to copy the URI to their clipboard instead of opening it with an app. In this post, we will show you how to add a “Copy URI to clipboard” button to the “Open With” dialogue box in Windows 10.
What is a URI?
A URI (Uniform Resource Identifier) is a string of characters that identifies a name or a resource on the Internet. A URI can be a web page, an image, a video, or any other type of resource that can be accessed via the Internet. URIs are used to link to resources on the Internet.
Why would you want to copy a URI to your clipboard?
There are several reasons why you may want to copy a URI to your clipboard instead of opening it with an app. For example, you may want to save the URI for later use, or you may want to share it with someone else. Copying the URI to your clipboard is a quick and easy way to do this.
How to add a “Copy URI to clipboard” button to the “Open With” dialogue box
To add a “Copy URI to clipboard” button to the “Open With” dialogue box in Windows 10, you will need to make a few changes to the Windows Registry. Here’s how to do it:
1. Press the Windows key + R to open the Run dialog box.
2. Type “regedit” (without the quotes) and press Enter to open the Registry Editor.
3. Navigate to the following registry key: HKEY_CLASSES_ROOTUnknownshell
4. Right-click on the “shell” key and select New > Key.
5. Name the new key “CopyURI”.
6. Right-click on the “CopyURI” key and select New > Key.
7. Name the new key “command”.
8. Double-click on the “(Default)” value in the right-hand pane.
9. In the “Value data” field, type “cmd.exe /c echo %1 | clip” (without the quotes).
10. Click OK to save the changes.
11. Close the Registry Editor.
Once you’ve completed these steps, you should see a new “Copy URI” option in the “Open With” dialogue box when you click on a link structured as a URI with a protocol like twitter://. Clicking on this option will copy the URI to your clipboard.
Conclusion
In this post, we’ve shown you how to add a “Copy URI to clipboard” button to the “Open With” dialogue box in Windows 10. This is a quick and easy way to copy URIs to your clipboard instead of opening them with an app. We hope that you found this post helpful and that you’re able to use this feature to improve your workflow in Windows 10.
Unfortunately, there isn‘t currently a way to add a “Copy URI to clipboard“ button to the “Open With“ dialogue box. However, you can use a third–party program like ClipboardFusion to add this functionality. It allows you to set up a hotkey so that when you click on a link structured as a URI with a protocol like twitter://, it will automatically copy the URI to your clipboard.
It is possible to have copying the URI be the default action for a protocol by making some modifications to the registry. These modifications are stored in the HKEY_CLASSES_ROOT
hive.
To do this, create a .reg file with the following content:
; twitter_protocol.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\twitter]
@="URL:twitter"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\twitter\shell]
@="open"
[HKEY_CLASSES_ROOT\twitter\shell\open]
[HKEY_CLASSES_ROOT\twitter\shell\open\command]
@="cmd /c ECHO|SET /P=%1|CLIP"
Once the file is created, double click on it to import the registry modifications.
The command line option specified in the registry is cmd /c ECHO|SET /P=%1|CLIP
. This is an overly complicated way of saying “print the input without an extra new line at the end”. The %1 is the input, which in this case is twitter://realDonaldTrump/status/266259787405225984. The | character is called the “pipe character”, which means that we are taking the output of what comes before it and giving it as input to what comes after it. The CLIP
command will read this pipe input and copy it to the clipboard.
For more information on file associations, this answer may help you.