With that said, let's jump right in.
HIVES
Sections of the registry are known as hives. The five most popular are:
- HKEY_CLASSES_ROOT
- HKEY_CURRENT_CONFIG
- HKEY_CURRENT_USER
- HKEY_LOCAL_MACHINE
- HKEY_USERS
$regkey = [Microsoft.Win32.Registry]::ClassesRoot
[array]$Names = $regkey.OpenSubKey("DataLinks").GetSubKeyNames()
foreach($n in $Names)
{
write-host $n
}
This returns: CLSID
I add this to the Datalinks subkey and make the call again:
[string]$Value = $regkey.OpenSubKey("DataLinks\CLSID").GetValue("")
write-host $value
And this returns:
{2206CDB2-19C1-11D1-89E0-00C04FD7A829}
I can then go to the clsid section and glean information about the location of the file:
[string]$value = $regkey.OpenSubKey("clsid\{2206CDB2-19C1-11D1-89E0-00C04FD7A829}\InprocServer32").GetValue("")
And that returns:
C:\Program Files\Common Files\System\Ole DB\oledb32.dll
No comments:
Post a Comment