How can I open a local HTML file in Microsoft Edge browser? How can I open a local HTML file in Microsoft Edge browser? windows windows

How can I open a local HTML file in Microsoft Edge browser?


This is currently not supported, but the team is evaluating it as an option. For the time being, the easiest way to open a resource in Edge is by using the microsoft-edge: protocol handler. For instance, you could run microsoft-edge:http://stackoverflow.com to open Stack Overflow in Edge.


Here is how you can open a PDF for example, with Edge.

Add the following header at the top of your class:

[DllImport("Shell32.dll")]public static extern int ShellExecuteA(IntPtr hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirecotry, int nShowCmd);

Here is an example of how to make the call.

ShellExecuteA(System.IntPtr.Zero, "open", @"shell:Appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge", "C:\MyFile.pdf", null, 10);

I think this will apply fine to other types of files as well.


New 2020: MS has updated it and it now works normally. Eg: Tested at cmd prompt on my w10 64b PC

"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"file:///C:/MyApplications/MyTestApp.htm

..that's all on one line, simple space between.

I'm no fan of MS, but here's their (slow) Egde Link for the latest version.