Skip to content

Instantly share code, notes, and snippets.

@mgeeky
Created January 12, 2022 12:24
Show Gist options
  • Save mgeeky/5a30a0619a7486b2fb0bd5233490fa64 to your computer and use it in GitHub Desktop.
Save mgeeky/5a30a0619a7486b2fb0bd5233490fa64 to your computer and use it in GitHub Desktop.
Enumerate Windows URI Handlers (Keys in HKEY_CLASSES_ROOT that contain "URL Protocol" values), examples: http:, calculator:, ms-officecmd:
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT -ErrorAction SilentlyContinue | Out-Null
$count = 0
try {
Get-ChildItem HKCR: -ErrorAction SilentlyContinue | ForEach-Object {
if((Get-ItemProperty $_.PSPath -ErrorAction SilentlyContinue).PSObject.Properties.Name -contains "URL Protocol") {
$name = $_.PSChildName
$count += 1
$line = "URI Handler {0:d4}: {1}" -f $count, $name
Write-Host $line
}
}
}
catch {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment