Launching Edge with a file URL
As noted in the comments, Edge does not support the file: protocol via the command line at this time.
However, it is currently possible to launch Edge with a local file using IApplicationActivationManager
. The necessary code can be extracted from the C# version of MicrosoftEdgeLauncher and integrated into a C# application.
See 'MicrosoftEdgeLauncherCsharp' at https://github.com/MicrosoftEdge/edge-launcher. To launch with a local file, use 'file:///d:/path/filename.ext' as the arguments
parameter to ActivateApplication
.
One dirty solution: first set your default launcher as Edge.
Suppose the file you want to open is file:///C:/foo/bar.html
, you can launch it using explorer
:
explorer file:///C:/foo/bar.html
Which will open Edge with the HTML for you.
This seems to be the only solution after start microsoft-edge:file:///C:/foo/bar.html
no longer works.