Running Microsoft Edge from script

2723 views
Skip to first unread message

Dave "Crash" Dummy

unread,
Aug 30, 2017, 7:33:05 AM8/30/17
to
I can run Internet Explorer from VBScript using the InternetExplorer object:

Set IE = CreateObject("InternetExplorer.Application")

Can I do the same thing with Microsoft Edge? How?

--
Crash

Genius is the ability to see the obvious.

Mayayana

unread,
Aug 30, 2017, 8:39:48 AM8/30/17
to
"Dave "Crash" Dummy" <inv...@invalid.invalid> wrote

| Set IE = CreateObject("InternetExplorer.Application")
|
| Can I do the same thing with Microsoft Edge? How?
|

Did you check the Registry for an application object
ProgID? I doubt it exists. Edge *is* IE. I don't know the
technical details. I suspect there's probably an edge.exe
along with iexplore.exe, but that they're both wrappers
around the same basic libraries like mshtml.dll, shdocvw.dll,
etc.

The difference is that Edge has most IE-specific
functionality removed. There's no option for compatibility
mode, VBScript, ActiveX, or any other IE-specific
fiunctionality. So even if there were an application
object it would be of little use. MS have tried to make
Edge a standards-consistent browser. And since IE is
still there for the sake of corporate customers who
use things like HTAs, there's really no reason to have a
redundant-but-crippled Edge object.


Dave "Crash" Dummy

unread,
Aug 30, 2017, 12:16:43 PM8/30/17
to
Thank you. I still use IE exclusively for browsing and HTA's extensively
locally. I was just wondering what I may be missing. Apparently, nothing.

There is an edge executable file buried deep within the system, but it
is outside the default system path. I haven't tried executing it either
from a script or the keyboard:

C:\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\MicrosoftEdge.exe
--
Crash

"The future ain't what it used to be."
~ Yogi Berra ~

JJ

unread,
Aug 31, 2017, 12:33:56 PM8/31/17
to
On Wed, 30 Aug 2017 08:39:00 -0400, Mayayana wrote:
>
> Did you check the Registry for an application object
> ProgID? I doubt it exists. Edge *is* IE. I don't know the
> technical details. I suspect there's probably an edge.exe
> along with iexplore.exe, but that they're both wrappers
> around the same basic libraries like mshtml.dll, shdocvw.dll,
> etc.

To clarify, Edge is not IE. Edge is an entirely separate web browser from
IE. It uses EdgeHTML engine rather than Trident (which is used by IE). I
actually checked this using Process Explorer. It shows that Edge doesn't
load any of IE's DLLs such as MSHTML.DLL or SHDOCVW.DLL when it shows a HTML
document.

Surprisingly, EdgeHTML's EMODEL.DLL has COM librar(ies), and one of its DLL
has interfaces which are identical (and extended) to Trident's. You can
compare this with IE's SHDOCVW.DLL/IEFRAME.DLL.

Windows 10 defaults to Trident's engine rather than EdgeHTML. i.e. the
registry data points to IE's DLL instead of Edge's. A program may choose to
use EdgeHTML instead of Trident if it wants to show HTML contents.

It's true that despite all these, it doesn't tell that the COM libraries in
Edge's DLL actually use EdgeHTML instead of Trident. But if it's just a
wrapper for Trident, why does it exists in the first place?

> The difference is that Edge has most IE-specific
> functionality removed. There's no option for compatibility
> mode, VBScript, ActiveX, or any other IE-specific
> fiunctionality. So even if there were an application
> object it would be of little use. MS have tried to make
> Edge a standards-consistent browser. And since IE is
> still there for the sake of corporate customers who
> use things like HTAs, there's really no reason to have a
> redundant-but-crippled Edge object.

IMO, the fact that Microsoft decided to make Edge to have COM interface
which is identical to Trident, means that they're planning on replacing
Trident with Edge entirely. Even though it'd mean that there would be no
more VBScript and ActiveX support.

HTML Application (HTA) may still be supported, though (without VBScript and
ActiveX, of course). Since it's just a bundle of files which is run using
special mode of web browser. Even if Microsoft doesn't provide the special
mode to run HTA files (which is equivalent to IE's MSHTA.EXE), it's still
possible to create one by using the COM libraries from Edge's DLLs.

Dave "Crash" Dummy

unread,
Aug 31, 2017, 2:00:26 PM8/31/17
to
JJ wrote:
> HTML Application (HTA) may still be supported, though (without VBScript and
> ActiveX, of course). Since it's just a bundle of files which is run using
> special mode of web browser. Even if Microsoft doesn't provide the special
> mode to run HTA files (which is equivalent to IE's MSHTA.EXE), it's still
> possible to create one by using the COM libraries from Edge's DLLs.

HTA without VBScript would be pretty useless.
--
Crash

English is not my native tongue; I'm an American.

Mayayana

unread,
Aug 31, 2017, 6:11:32 PM8/31/17
to
"JJ" <jj4p...@vfemail.net> wrote

| To clarify, Edge is not IE. Edge is an entirely separate web browser from
| IE. It uses EdgeHTML engine rather than Trident (which is used by IE). I
| actually checked this using Process Explorer. It shows that Edge doesn't
| load any of IE's DLLs such as MSHTML.DLL or SHDOCVW.DLL when it shows a
HTML
| document.
|

Interesting to know, though they did say that it was
based on Trident with the IE-specific things stripped
out. It's possible that they've just duplicated the libraries
for the fork.
Which brings up the question of how the basic IE
libraries like urlmon.dll get used.


| IMO, the fact that Microsoft decided to make Edge to have COM interface
| which is identical to Trident, means that they're planning on replacing
| Trident with Edge entirely. Even though it'd mean that there would be no
| more VBScript and ActiveX support.
|
My understanding is that they've already replaced
IE. That seems clear. But it needs to be kept around
for coprorate customers who are heavily invested in
HTAs, ActiveX, etc.

| HTML Application (HTA) may still be supported, though (without VBScript
and
| ActiveX, of course). Since it's just a bundle of files which is run using
| special mode of web browser. Even if Microsoft doesn't provide the special
| mode to run HTA files (which is equivalent to IE's MSHTA.EXE), it's still
| possible to create one by using the COM libraries from Edge's DLLs.

But the whole point of an HTA is no security. What
sense would it make to have an HTA with no VBS,
no ActiveX and normal security. That's not an HTA.
It's merely a local webpage.


Mayayana

unread,
Aug 31, 2017, 10:39:57 PM8/31/17
to
There's an explanation here, as least partly:

https://www.smashingmagazine.com/2015/01/inside-microsofts-new-rendering-engine-project-spartan/

They forked IE, then stripped the risky functionality
and anything that wasn't standards-compliant. Then
they started adding in newer functionality. All in a
sandboxed security framework.
Of course, that's the official story. It doesn't explain
why so many people seem to dislike Edge and why it's
sunk almost out of sight in terms of usage.

But I think this article explains the basic strategy:
Create a safe browser that can compete on standards
compliance while also leaving IE in place for corporate
use.



JJ

unread,
Sep 1, 2017, 8:06:54 AM9/1/17
to
On Thu, 31 Aug 2017 18:10:55 -0400, Mayayana wrote:
> "JJ" <jj4p...@vfemail.net> wrote
>
>| HTML Application (HTA) may still be supported, though (without VBScript
> and
>| ActiveX, of course). Since it's just a bundle of files which is run using
>| special mode of web browser. Even if Microsoft doesn't provide the special
>| mode to run HTA files (which is equivalent to IE's MSHTA.EXE), it's still
>| possible to create one by using the COM libraries from Edge's DLLs.
>
> But the whole point of an HTA is no security. What
> sense would it make to have an HTA with no VBS,
> no ActiveX and normal security. That's not an HTA.
> It's merely a local webpage.

EdgeHTML as it is now is similar like WebKit, and Chakra is similar to V8.
V8 and WebKit are widely used for web application development frameworks.
IOTW, HTA may no longer be a web based application for systems. But rather
normal application.

But let's not forget the special mode to run the HTA files, here. That mode
may actually expose VBScript and ActiveX, in order to keep compatibility.

What people are most complains about is the ActiveX in the web browser. They
don't complain about (or don't even aware of) ActiveX in HTA. HTA may infact
be unaffected by Edge.

JJ

unread,
Sep 1, 2017, 8:13:38 AM9/1/17
to
On Thu, 31 Aug 2017 14:00:22 -0400, Dave "Crash" Dummy wrote:
> JJ wrote:
>> HTML Application (HTA) may still be supported, though (without VBScript and
>> ActiveX, of course). Since it's just a bundle of files which is run using
>> special mode of web browser. Even if Microsoft doesn't provide the special
>> mode to run HTA files (which is equivalent to IE's MSHTA.EXE), it's still
>> possible to create one by using the COM libraries from Edge's DLLs.
>
> HTA without VBScript would be pretty useless.

More like useless without ActiveX, not VBScript. Cause AFAIK, it'd still be
usable using JScript or even JavaScript, assuming that ActiveX is still
exposed to HTA.

Mayayana

unread,
Sep 1, 2017, 9:11:24 AM9/1/17
to
"JJ" <jj4p...@vfemail.net> wrote

| EdgeHTML as it is now is similar like WebKit, and Chakra is similar to V8.
| V8 and WebKit are widely used for web application development frameworks.
| IOTW, HTA may no longer be a web based application for systems. But rather
| normal application.
|

HTA never was web-based. One of the few requirements
is that it must be running locally. "Web applications" are a
different animal -- essentially highly interactive webpages
built almost entirely of javascript. Really not webpages at all.
Those only use what people like to pretend is safe scripting.
They are designed to be powerful in terms of visitor tracking,
interactivity and back-end connection. HTAs are a UI for
Windows programming. The only commonality is the heavy use
of scripting in an HTML-rendering window.

| But let's not forget the special mode to run the HTA files, here. That
mode
| may actually expose VBScript and ActiveX, in order to keep compatibility.
| What people are most complains about is the ActiveX in the web browser.
They
| don't complain about (or don't even aware of) ActiveX in HTA. HTA may
infact
| be unaffected by Edge.

Yes. They stripped down IE and rebuilt it to make
Edge as a "normal" web browser. It no longer has
access to VBS, ActiveX, BHOs, or any of the Explorer
tie-in. That's radical. In a sense it's a return to the
pre-Active Desktop IE.

I don't know how many people are aware of the
IE/Explorer tie-in, but it's very extensive. I once wrote
an Explorer Bar shell extension. (The panel on the left in
folder windows.) It can't be separated from IE. One
can only filter IE-related messages. Or conversely, if
writing the Bar for IE one gets the tie-in to folder
windows. And the listview object in a folder window
is still an InternetExplorer object.
I've also written a mime filter. With just a couple of
Registry entries one gets complete control over IE
webpages *before* IE gets them.
Then there are common functions like URLDownloadToFile.
Many programmers use that to download files, but it's
actually an IE wrapper.

IE is part of the Windows API in many ways. MS did
that deliberately to 1) beat out Netscape and 2) make
a case in court that they couldn't separate IE from
Windows. They didn't just make a browser to compete
with Netscape. They molded an OS to compete with
Netscape. Adding ActiveX and COM scripting worked out
so well that they kept going. That single addition of
CreateObject (or ActiveXObject) made all the difference.
When security became a concern they came up with
HTAs so that IE itself could be made more secure. In a
sense, the HTA invention was the first fork, but only
a partial one. Shdocvw.dll was wrapped by mshta.exe for
HTAs and by iexplore.exe for IE.

Edge is a sandboxed version meant to compete with
other browsers and be standards-compatible. It makes
sense. They can't make a safe browser without separating
it from Windows. But of course there is the question
of whether it's sufficiently separated from Windows.
Either way, it's sterile for scripting purposes.

Which means the future of HTAs has nothing to do
with Edge, one way or the other. It just depends on
whether MS feels they need to keep supporting
corporate scripting, which means keeping IE around.

Even now, IE11 can use compatibility mode to bring
back normal IE functionality like VBS. Edge can't. It
doesn't have that functionality at all. The Edge
userAgent is actually spoofed to mention Chrome,
Safari and Gecko, while removing "MSIE". They want
webpage designers to treat it like the other major
browsers.

I think what they did makes a lot of sense. IE can
now be the scripting UI for Windows software. The
only problem is that they still insist on trying to use
their browser for customer lock-in. They're still being
sleazy. Edge is still tied to Windows and it's being
designed for "consumer" use, with emphasis on things
like push notifications AKA ad subscriptions.
A new, sleazy browser that can only work on 25% of
Windows computers and can't run at all on Mac or
Linux is not a browser. It's a crippled specialty program.
A Win10 "phone app". On my own site I check for
IE11 and Edge. For visitors using IE11 I show a message
saying they need to enable compat mode. For visitors
using Edge I show a message that they'll need to use
*any* other browser. It's bad enough that I need special
webpages just for IE. I'm not about to buy Win10 and
start testing a 3rd set of pages for a new browser
used by just a few people. It's unfortunate that MS don't
just make a real browser. They're so good at making
software. It's only the sleaze factor that messes it up.
I don't doubt that if they went about it with honesty
and decency, just trying to make a good browser to
serve the customer as well as possible, they could make
the best and most innovative browser, and that they
could do it without any sneaky leveraging of Windows.


Thomas Boomer

unread,
Mar 31, 2021, 11:27:23 AMMar 31
to
Yeah they do in fact support VBScript in Edge Chromium.

R.Wieser

unread,
Mar 31, 2021, 11:44:06 AMMar 31
to
Thomas,

> Yeah they do in fact support VBScript in Edge Chromium.

How old is Edge Chromium ? And how old is the post you responded to ?

Do I need to say more ?

Regards,
Rudy Wieser




"Thomas Boomer" <amarsi...@gmail.com> wrote in message
news:3f6aca21-ec3e-4998...@googlegroups.com...

JJ

unread,
Mar 31, 2021, 1:14:12 PMMar 31
to
On Wed, 31 Mar 2021 08:27:21 -0700 (PDT), Thomas Boomer wrote:
> Yeah they do in fact support VBScript in Edge Chromium.

No it's not. Edge (labelled) Chromium do not and will never support VBScript
natively. Edge (labelled) Chromium is not MSIE and does not use MSIE engine.
Reply all
Reply to author
Forward
0 new messages