Recently, i responded to a post about out parameters (Read registry value remotely with WMI : "Can functions have an OUT parameter" ). As a good exercise, i have tried to rewrite all functions provided by WMI provider StdRegProv (except those about Security Descriptor).

The file joined to this post is the result of my work. It contains a .zip file including 5 files :
- "readme.txt" short description of functions and parameters
- "Library - WMIRegistry.kix" library containing global constants and functions (high and low level)
- "Demo WMI Registry Read High Level.kix" example of use for high-level functions
- "Demo WMI Registry Read Low Level.kix" example of use for low-level functions
- "Demo WMI Registry Measurement.kix" example to measure execution time with high-level, low-level and native kix functions

With this library, you can :
- create, delete or enum subkey
- read, write, delete or enum value
- check access rights to a registry key

Last native function not implemented is KeyExist !!!

there are two ways to read value :
WMIRegistryReadValue searchs the type of the value before reading the value.
WMIRegistryReadValueWithType needs the type of value as parameter to get directly the value.


High-level functions get parameter like native KiXtart functions (except for UNC syntax. no support for "\\remote server\hkey_...\regkey" because "remote computer" is included in the optional parameter $strComputer). They create a WMI connection to registry, do the required action and then close connection (implicit).

Low-level function need you to establish first the connection and use the WMI object as parameter. This is faster.

I hope this set of files will be useful to someone.

Christophe


Attachments
WMI Registry.zip (329 downloads)
Description:




Edited by ChristopheM (2014-08-25 11:04 PM)
_________________________
Christophe