cscript installer_sw_lister.js+
installed_sw_lister.js:
var strserver = “127.0.0.1″
var StrUser = “”
var StrPass = “”getsw (strserver)function getsw (strserver)
{
sRegTypes = new Array(
” “, // 0
“REG_SZ “, // 1
“REG_EXPAND_SZ “, // 2
“REG_BINARY “, // 3
“REG_DWORD “, // 4
“REG_DWORD_BIG_ENDIAN “, // 5
“REG_LINK “, // 6
“REG_MULTI_SZ “, // 7
“REG_RESOURCE_LIST “, // 8
“REG_FULL_RESOURCE_DESCRIPTOR “, // 9
“REG_RESOURCE_REQUIREMENTS_LIST”, // 10
“REG_QWORD “); // 11HKLM = 0×80000002;sRegPath = “SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall”
//sRegPath = “SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Adobe Acrobat 5.0″
getkey (sRegPath);
}
//———————-function getkey (sRegPath)
{
oLoc = new ActiveXObject(”WbemScripting.SWbemLocator”);
oSvc = oLoc.ConnectServer(strserver, “root\\default”, StrUser, StrPass);
oReg = oSvc.Get(”StdRegProv”);oMethod = oReg.Methods_.Item(”EnumKey”);
oInParam = oMethod.InParameters.SpawnInstance_();
oInParam.hDefKey = HKLM;
oInParam.sSubKeyName = sRegPath;
oOutParam = oReg.ExecMethod_(oMethod.Name, oInParam);aNames = oOutParam.sNames.toArray();for (i = 0; i <= aNames.length -1; i++)
{
// WScript.Echo(”number” + i + ” KeyName: “, aNames[i]);
var keyname = aNames[i]
getskey (keyname);
}
}
//End getting software key names
//———————-function getskey (keyname)
{
try {
oMethod = oReg.Methods_.Item(”EnumValues”);
oInParam = oMethod.InParameters.SpawnInstance_();
oInParam.hDefKey = HKLM;
oInParam.sSubKeyName = sRegPath + “\\” + keyname;
oOutParam = oReg.ExecMethod_(oMethod.Name, oInParam);
var newreg = sRegPath + “\\” + keyname
// WScript.echo (newreg);
bNames = oOutParam.sNames.toArray();
aTypes = oOutParam.Types.toArray();for (j = 0; j <= bNames.length -1; j++)
{
if (aTypes[j] == “1″) {
// WScript.Echo(” Subkey: “, bNames[j] + ” and Type: ” + aTypes[j]);
subkeyval = bNames[j];
getskeyval (subkeyval, newreg);
} else {
}
}
} catch (error) {
}
}
//End get subkeys
//————————
function getskeyval (subkeyval, newreg)
{
if (subkeyval == “DisplayName” || subkeyval == “QuietDiaplayName”)
{
oMethod = oReg.Methods_.Item(”GetStringValue”);
oInParam = oMethod.InParameters.SpawnInstance_();
oInParam.hDefKey = HKLM;
oInParam.sSubKeyName = newreg;
oInParam.sValueName = subkeyval;oOutParam = oReg.ExecMethod_(oMethod.Name, oInParam);cNames = oOutParam.sValue WScript.echo (”SubkeyStringValue = ” + cNames);
} else {
}
}
(forrás: http://cwashington.netreach.net/depo/view.asp?Index=769&ScriptType=jscript)
szombat, június 09, 2007
Telepített programok listázása
Feliratkozás:
Megjegyzések küldése (Atom)
Nincsenek megjegyzések:
Megjegyzés küldése