Skip to content

Instantly share code, notes, and snippets.

@MyITGuy
Created September 17, 2019 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MyITGuy/0ac89acf4cac077c36c7576fa285d4b4 to your computer and use it in GitHub Desktop.
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.)
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