[Project_owners] Finding OS Path
Patrick Brunschwig
patrick.brunschwig at gmx.net
Mon Sep 17 00:48:13 PDT 2007
InBasic wrote:
> hi
>
> i need to find the path of system and system32 in my extension, something
> like %SystemRoot% that work with firefox
> any body can help ?
You could access the Windows registry:
var registry =
Components.classes["@mozilla.org/windows-registry-key;1"].
createInstance(Components.interfaces.nsIWindowsRegKey);
registry.open(registry.ROOT_KEY_LOCAL_MACHINE,
"Software\\Microsoft\\Windows NT\\CurrentVersion",
registry.ACCESS_READ);
var systemRoot = registry.readStringValue("SystemRoot");
registry.close();
-Patrick
More information about the Project_owners
mailing list