![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | WMI access to registry I'm having a lot of trouble figuring out how to use WMI to access the Windows Registry. The only command I can see that does it is something like this... (get-wmiobject StdRegProv -namespace "root/default").Enumkey("HKEY_Local_machine", "Software/Microsoft", $regobj) But this command returns the following error: You cannot call a method on a null-valued expression. At line:1 char:61 + (get-wmiobject stdregprov -namespace "root/default").EnumKey( <<<< "HKEY_LOCAL_MACHINE", "software\microsoft", $regobj) Any ideas? |
| | #2 (permalink) |
| Guest | Re: WMI access to registry I am not sure about using the get-wmiobject cmdlet, but you can use [WMICLASS]/ManagementClass as shown below: [long]$HKLM = 2147483650 $c = [WMICLASS]"root\default:stdregprov" $g = $c.enumkey($HKLM,"software\microsoft") $g | % { $_.sNames } Even easier... use the builtin Powershell Provider to navigate the registry of a local PC: PS HKLM:\> cd HKLM:\software\microsoft PS HKLM:\software\microsoft> ls Hive: Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\software\microsoft SKC VC Name Property --- -- ---- -------- 4 0 .NETCompactFramework {} 4 4 .NETFramework {InstallRoot, sdkInstallRootv2.0, DbgManagedDebugger, DbgJITDebugLaunchSetting} 6 2 Active Setup {DisableRepair, JITSetupPage} 1 0 ActiveSync {} 3 0 AD7Metrics {} 1 0 ADs {} 8 0 Advanced INF Setup {} "Jonathan P" <JonathanP@discussions.microsoft.com> wrote in message news:F45E9B64-0D1A-455D-B1EE-33A96DB51E37@microsoft.com... > I'm having a lot of trouble figuring out how to use WMI to access the Windows > Registry. The only command I can see that does it is something like this... > (get-wmiobject StdRegProv -namespace > "root/default").Enumkey("HKEY_Local_machine", "Software/Microsoft", $regobj) > But this command returns the following error: > You cannot call a method on a null-valued expression. > At line:1 char:61 > + (get-wmiobject stdregprov -namespace "root/default").EnumKey( <<<< > "HKEY_LOCAL_MACHINE", "software\microsoft", $regobj) > Any ideas? |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to access the method of a registry key | Seeker | PowerShell | 1 | 4 Weeks Ago 12:41 PM |
| Access to Registry | pgwolfe | Windows Updates | 0 | 06-20-2008 09:11 AM |
| When standard users access Vista registry remotely, Access Denied | Gayle | Vista account administration | 1 | 10-10-2007 11:48 AM |
| Registry Access | Wayne | Vista General | 0 | 01-29-2007 10:43 AM |
| Registry Access | Tim Gee | Vista security | 6 | 11-27-2006 06:10 PM |