1

I have a need to open Linux .desktop web links on a windows machine. Currently I drag the web page's address to a shared folder in Linux, and that is available on the LAN for others to open. This works fine with other Linux machines on the LAN, but Windows machines are not reading the URL.

The Linux .desktop link is actually a small text file, and the URL is embedded in its last line. But Windows does not recognize the file type, and when I associate it with a browser in Windows (vivaldi, in my case), the browser simply opens the .desktop file as a text file rather than going to the desired URL target.

Is there any way to get Windows to pass the .desktop target info to a browser?

Thanks.

1
  • Is there any way to get Windows to pass the .desktop target info to a browser No, there isn't. .desktop files are Linux specific and not even meant to share URLs but as a "shortcut" to run software.
    – user772515
    Mar 22, 2018 at 18:23

3 Answers 3

2

There is no common format to store weblinks as a file. Windows uses .lnk-files to link to applications, files and web locations, while Linux uses the more flexible .desktop-files. You could probably write a small script that reads a .desktop-file and puts the link information in a .lnk-file (or opens the link as a target in your preferred browser), but this is not a common task (and we're not on Software Reccommendations here). However, you might create a basic HTML file on the shared folder where you put in all the links you want to share, and open that HTML file on each target system, so you can easily reload the page and click the link after you added something. Works as well with a .docx/.odt/other text file containing clickable links, etc.

Besides that, you'd probably be best off using some service to synchronise your browsers, but for that you'd have to ask on Software Reccommendations.

4
  • Thank you. I was thinking of a script, but hoped to avoid it. I suppose an auto-it script to pull the URL out of the .desktop file and pass it to the browser would work, and the .desktop extension could be associated with it. More work than I wanted to do though. Thanks again.
    – Paul B.
    Mar 22, 2018 at 18:58
  • Yeah, that might work. I don't know about "Auto-it" though. You might want to ask a specific question for a script that does that task.
    – LukeLR
    Mar 22, 2018 at 18:59
  • Found it. Wow, it's very easy with the right code. Will post it as an answer. Thanks again.
    – Paul B.
    Mar 22, 2018 at 19:35
  • 1
    @PaulB. Great! Glad you found something :)
    – LukeLR
    Mar 22, 2018 at 20:59
2

I found a very easy solution to this, with thanks to @LukeLR here for a little encouragement.

Over at https://www.computing.net/answers/programming/batch-file-to-extract-address-from-url-file/27904.html, "Razor" posted a batch file that will find a URL in a text file. I had to amend the path to Chrome, which evidently now installs in the standard C:\Program Files folder.

All I did then was go Open With... for a .desktop file and point to the batch file, with the Always use this program ticked. Now, just clicking on a .desktop file will open the url in Chrome (which I will soon switch to point to Vivaldi).

Very concise and effective.

0

I found none of the answers above worked for me.

I got it working tho and posted the method here:

https://nerdfever.com/make-windows-open-urls-in-linux-desktop-files/

You must log in to answer this question.

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