Created
September 17, 2019 13:36
-
-
Save MyITGuy/0ac89acf4cac077c36c7576fa285d4b4 to your computer and use it in GitHub Desktop.
Used to capture the path of the default icon for the installation of Microsoft Access. This can then be used with ConvertFrom-OfficeProductCode to determine the Microsoft Access installation type (full vs. runtime, etc.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-AccessDefaultIconPath { | |
[CmdletBinding(SupportsShouldProcess = $True, DefaultParameterSetName = "None")] | |
PARAM( | |
[string] | |
$ComputerName | |
) | |
try { | |
if ($ComputerName) { | |
$key = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, $ComputerName) | |
} | |
else { | |
$key = [Microsoft.Win32.Registry]::LocalMachine | |
} | |
$subkey = $key.OpenSubKey('SOFTWARE\Classes\Access.Application\CurVer', $false) | |
$CurVer = $subkey.GetValue("") | |
$subkey = $key.OpenSubKey("SOFTWARE\Classes\$CurVer\DefaultIcon", $false) | |
$subkey.GetValue("") | |
} | |
catch { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment