Node.JS (http://nodejs.org/) has been a great Javascript-server side tool). Previous posts on this topic can be found [here].
However, the NodeJS does not inherently support the Win32 COM/OLE techniques maybe because it is designed to be platform independent in the first place, like Python, which is similar in the case that you will need to download the win32com package [see here].
How to Call COM Object in NodeJS?
In order to use the COM object in server-side Javascript, you will have to download the win32ole package from npmjs (https://npmjs.org/package/win32ole) website.
Upon successful installation, you will find the folder node_modules at the drive where you initiative the command.
The following shows the most simple example of using COM object in the server-side Javascript, which is quite similar of using COM object in Python script [see here] with the help of win32com package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | /* * * Node.JS Demo using COM * https://helloacm.com */ (function () { try { var win32ole = require('win32ole'); var WSH = win32ole.client.Dispatch('WScript.Shell'); WSH.popup("Hello, world!"); } catch (e) { console.log(e); } })(); |
/* * * Node.JS Demo using COM * https://helloacm.com */ (function () { try { var win32ole = require('win32ole'); var WSH = win32ole.client.Dispatch('WScript.Shell'); WSH.popup("Hello, world!"); } catch (e) { console.log(e); } })();
Oh yeah, it succeeds!
You might also be interested in this post: How to Call COM Object in C++ Unmanaged Code?
–EOF (The Ultimate Computing & Technology Blog) —
loading...
Last Post: Lock Serial Number to Hardware in Licensing using VMProtect
Next Post: USB OTG (On The Go)
Is win32ole also supports macOS COM objects to access?