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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.