strcomputer = "."; var objwmiservice = GetObject("winmgmts:\\\\" + strcomputer + "\\root\\cimv2"); var colfilelist = objwmiservice.execquery ("associators of {win32_directory.name='c:\\windows\\system32'} where " + "resultclass = cim_datafile"); var myJS_Enumerator_1 = new Enumerator(colfilelist); for (;!myJS_Enumerator_1.atEnd();myJS_Enumerator_1.moveNext()) { objfile = myJS_Enumerator_1.item(); if (objfile.extension == "dll") { WScript.Echo(objfile.name + " -- " + objfile.version); } }