HTA Files and Microsoft Edge

Viewed 557

I have a HTA application. Within the HTA, I'm calling a function to open up a webpage using:

window.open( sURL, "Working" );

This opens a page in Internet Explorer and not Edge.

Is there a way to default window.open to open a webpage in Edge?

1 Answers

Using window.open in an HTA will always open the specified URL in Internet Explorer, even in Windows 11 (build 22000.348 or higher required). If you wish to open a web page in Edge, you can do so using the Run method:

Set oWSH = CreateObject("WScript.Shell")
oWSH.Run "msedge.exe --new-window ""https://www.cnn.com""",0,False
Related