Question

I'm trying to use sockets to connect to a server through HTA scripting. Is this possible? There's isn't much information on the web, some examples would be greatly appreciated.

Was it helpful?

Solution

There is no socket access built into JScript, but you can use any of the installed ActiveX components.

I guess there are some 3rd party ones that provide raw socket access, but there are none in vanilla Windows installations. This means you'd not only have to distribute the HTA, but also install an ActiveX component, which would make deployment rather cumbersome.

If you can, use HTTP as a way to access remote resources, and use the built-in XmlHttpRequest or WinHttpRequest objects that comes with Windows.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top