通过powershell获取本机存在的伪协议
2022-9-2 11:42:32 Author: wutongyu.info(查看原文) 阅读量:38 收藏

其实之前也有一个vbs脚本了,但是老是执行会报错,上网找了一个ps脚本,powershell执行。

执行之前需要管理员运行powershell

在powershell执行:

Set-ExecutionPolicy Unrestricted -Scope CurrentUser

选是:

可以列出所有本机安装软件关联的伪协议

附ps代码:

foreach ($Key in Get-ChildItem Microsoft.PowerShell.Core\Registry::HKEY_CLASSES_ROOT) {
    $Path = $Key.PSPath + '\shell\open\command'
    $HasURLProtocol = $Key.Property -contains 'URL Protocol'

    if (($HasURLProtocol) -and (Test-Path $Path))
    {
        $CommandKey = Get-Item $Path
        $Scheme = $Key.Name.SubString($Key.Name.IndexOf('\') + 1) + ':'
        Write-Host $Scheme $CommandKey.GetValue('')
    }
}

文章来源: http://wutongyu.info/powershell_get_agreement/
如有侵权请联系:admin#unsafe.sh