That should be easy enough to do in autohotkey, and one of the autohotkey people will surely report how to do it.
I'll just mention that if you use my Find and Run Robot
, you can configure a hotkey that tells FARR to copy the text under the clipboard and then launch farr with that text in the search window. From there you could hit enter to open or launch the file (if the text under the clipboard was a file) or hit enter to launch a url, or let FARR do a search for whatever text is under clipboard. In this way FARR might be a more general solution to what you are interested in.
Note, by default FARR as an example hotkey that almost does this -- just select some text under cursor and hit Ctrl+Break. The difference is that this default hotkey example adds the word "search " prior to launching with the text under cursor, and so is useful for performing web searches for the text.