Open squadjot opened 3 days ago
Check out WelsonJS, it seems to fit the bill. https://github.com/gnh1201/welsonjs
Shell.Application
https://github.com/gnh1201/welsonjs/blob/2ba05aa633dad23fc31508bca027466146f45366/lib/shell.js#L143-L152
WbemScripting.SWbemLocator
https://github.com/gnh1201/welsonjs/blob/2ba05aa633dad23fc31508bca027466146f45366/lib/wmi.js#L15-L27
WelsonJS uses mshta? ( IE11 at best ) I'm coming from using HTA's. I want to make my apps in a modern webbrowser with the v8 engine. Also.. WelsonJS seems like a bit like a frankensteins monster
Hiiiii ❤️
So, Windows Script Host : The scripting environment on windows that let's you do almost everything related to computer management. You can write vb and/or javascript files , and run them in WSH to get things done on a windows machine.
In cscript, wscript, mshta, ie you can do things like:
var objShell = new ActiveXObject("Shell.Application");
And get an instance of shell COM object and do stuff with it.Could also be:
new ActiveXObject("WIA.ImageProcess"); ,
and scan some drawings on your scanner (lol , maybe not very a realistic use case, but still.. )Or get access to WMI
There's plenty of useful things to do with it, and it's not going away any time soon.. it's the backbone of windows management.
In a windows script (javascript/jscript), All this is implemented with one single function: new ActiveXObject... (ActiveX??? yuck..yea i know) - with that, you have access to a complete javascript interface / interop for controlling windows, just waiting to be utilized.
And! It's definitely technically possible to implement in a modern browser. Some argue that it only works in legacy IE browsers and WSH, but that's not true. I recently made it work in a WebView2 edge component ( c# Winform app ); I just made my own "ActiveXObject" method. and could use it, just like i was in a HTA or WSH. And it's full interop, not some json API.
In C# it was just a matter of doing:
And in the browser document you can get access to the object by doing something like:
I'm not all sure how this would be done in C , probably not as easy. But.. maybe not too hard? And if it's "easy" to implement, then why not?