Launch browser from .URL shortcut

Issue #43 new
Matt Wilkie created an issue

It would be nice if BC2 understood what to do with Windows .URL link files. This way it could be registered as the default handler for them.

Revealing current handler using ASSOC and FTYPE:

> assoc .url
.url=InternetShortcut

> ftype InternetShortcut
InternetShortcut="C:\Windows\System32\rundll32.exe" "C:\Windows\System32\ieframe.dll",OpenURL %l

Unfortunately assigning handler can’t be done with FTYPE anymore in Windows 10+, but it’s still possible with a registry edit when opening with elevated privileges. I know how to do this in python[1] but not VB.net.

I also found http://kolbi.cz/blog/2017/10/25/setuserfta-userchoice-hash-defeated-set-file-type-associations-per-user/

Sample URL file:

[InternetShortcut]
URL=https://internal-domain.lan/collab/site1/GIS/_layouts/OneNote.aspx?id=%2Fcollab%2Fenv-c1%2FGIS%2FShared%20Notebooks%2FParks&wd=target%28Some%2C%20Page.one
IDList=
HotKey=0
IconFile=C:\Users\myusename\AppData\Local\Mozilla\Firefox\Profiles\ckk345im.default\shortcutCache\51Ep7Gs789adfhQvHQ7NQ==.ico
IconIndex=0
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,11

[1] Python register file type example, def register_leo()
https://github.com/leo-editor/leo-editor/blob/devel/leo/scripts/win/register-leo.leox#L56-L108

Comments (1)

  1. guy repo owner

    Interesting. I haven’t tried .URL files but you should be able to set BC2 as it’s default. You can do this in BC2’s settings. You cannot change some handlers due to MS’s security policies.

    About the tool, he does not share his source code so I can’t do anything with it. I don’t know what the licencing is so I also cannot include it in as a stand-alone.

    In anycase, this tool is not currently being developped, it’s on hold. I might pick it up in the future, but not in the near term.

  2. Log in to comment