Tuesday, March 27, 2012

JavaScript (Win32 CScript) -- Reading the Registry

// reading the Registry from the command line

var oShell = WScript.CreateObject("WScript.Shell");
var p = oShell.RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Office\\11.0\\Excel\\InstallRoot\\Path");

// p is now the installation path of Excel 2003