Reposted working code
(I’m trying to get Arrays from my ActiveX component, but with no luck. When I run the script I get empty Message Box, but I know that the Array are there:)
var objMain, objAdapt, lgCount, stMsg = "";
objMain = new ActiveXObject("nnetcom.oMain");
objMain.UnlockComponent("xxx-xxxxx-xxxxx-xx");
objAdapt = new ActiveXObject("nnetcom.oNetworkAdapter");
objAdapt.GetNetworkAdapters(); // Collects Network Adapters
vrAdapters = objAdapt.cName; // cName holds collected Network Adapter names
var vrAdaptVB = new VBArray(vrAdapters);
var vrAdaptJS = vrAdaptVB.toArray();
for (lgCount in vrAdaptJS) {
stMsg = stMsg + vrAdaptJS[lgCount] + '\r\n';
}
WScript.Echo(stMsg);
objAdapt = null
objMain = null
Or simplest way from my first posted answer would be:
This example also works fine for me!