You can, if you use JScript (Microsoft's implementation of Javascript for Windows) and some information e.g.
- Calling WMI Methods with JScript
- Troubles with WMI in JScript
(found by googling "jscript wmi").
Evidence:
function showUnInstall() {
var HKEY_LOCAL_MACHINE = 0x80000002;
var uninstallRegKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
var stdRegPro = "winmgmts:{impersonationLevel=impersonate}!//./root/default:StdRegProv";
var objReg = GetObject(stdRegPro);
var mEnumKey = objReg.Methods_.Item("EnumKey");
var ipEnumKey = mEnumKey.InParameters.SpawnInstance_();
ipEnumKey.hDefKey = HKEY_LOCAL_MACHINE;
ipEnumKey.sSubKeyName = uninstallRegKey;
var mGetStringValue = objReg.Methods_.Item("GetStringValue");
var ipGetStringValue = mGetStringValue.InParameters.SpawnInstance_();
ipGetStringValue.hDefKey = HKEY_LOCAL_MACHINE;
ipGetStringValue.sValueName = "DisplayName";
var opEnumKey = objReg.ExecMethod_(mEnumKey.name, ipEnumKey);
if (0 === opEnumKey.ReturnValue) {
var aNames = opEnumKey.sNames.toArray();
for ( var i = 0; i < aNames.length; ++i) {
ipGetStringValue.sSubKeyName = uninstallRegKey + "\\" + aNames[i];
var opGetStringValue = objReg.ExecMethod_(mGetStringValue.name, ipGetStringValue);
if (0 === opGetStringValue.ReturnValue) {
WScript.Echo(opGetStringValue.sValue);
} else {
WScript.Echo("ERROR: GetStringValue.ReturnValue =", opGetStringValue.ReturnValue);
}
}
} else {
WScript.Echo("ERROR: EnumKey.ReturnValue =", opEnumKey.ReturnValue);
}
}
output:
cscript 26907078.js
7-Zip 4.65
ActiveState ActiveTcl 8.5.2.0
ERROR: GetStringValue.ReturnValue = 1
Adobe Flash Player 15 Plugin
ERROR: GetStringValue.ReturnValue = 1
CMake 2.8, a cross-platform, open-source build system
Acrobat.com
...