Re: Reding a DWORD value with WMI
From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 06/15/04
- Next message: Paddy: "INTRANET FTP ????"
- Previous message: poget: "Reding a DWORD value with WMI"
- In reply to: poget: "Reding a DWORD value with WMI"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 16 Jun 2004 00:00:38 +0200
poget wrote:
> I have tried unsiccessfuly to find out the value of the ExplorerFlags key
> which can be 16 or 34 (decimal).
> Incidentally where can I find the Const values for the Registry Hives?
> TIA
> Phil
>
> Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
> _ strComputer & "\root\default:StdRegProv")
>
> strKeyPath = "HKCR\Folder\shell\open"
> strValueName = "ExplorerFlags"
> oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue
> WshShell.PopUp dwValue ' doesn't even show up!
Hi
Here is an updated/corrected version of your script
(returns the value 18 for me):
'--------------------8<----------------------
Const HKCR = &H80000000
Const HKCU = &H80000001
Const HKLM = &H80000002
strComputer = "." ' use "." for local computer"
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\default:StdRegProv")
strKeyPath = "Folder\shell\open" ' do not add the hive name in front here
strValueName = "ExplorerFlags"
oReg.GetDWORDValue HKCR, strKeyPath, strValueName, dwValue
WScript.Echo dwValue
'--------------------8<----------------------
-- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/community/scriptcenter/default.mspx
- Next message: Paddy: "INTRANET FTP ????"
- Previous message: poget: "Reding a DWORD value with WMI"
- In reply to: poget: "Reding a DWORD value with WMI"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|