The following file test.cc is to launch Microsoft Edge with specific URL:
#include <Windows.h>
int main()
{
SHELLEXECUTEINFOW sei = { sizeof sei };
sei.lpVerb = L"open";
sei.lpFile = L"microsoft-edge:http://www.stackoverflow.com";
ShellExecuteExW(&sei);
}
Compile with:
cl test.cc /link shell32.lib
It works in Windows 10 (Edge opened to specific URL), but in Windows Server 2016 this program pops up an error window:
Title: microsoft-edge:http://www.stackoverflow.com
Content: This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel.
I checked "Default Programs" in control panel and already chose "Set this program as default" in Microsoft Edge page.