从powershell枚举URL方案
嘿,我正在尝试枚举注册表中的URL方案,但不幸的是,这比我想象的要难一些 所以首先从powershell枚举URL方案,powershell,url,registry,Powershell,Url,Registry,嘿,我正在尝试枚举注册表中的URL方案,但不幸的是,这比我想象的要难一些 所以首先 New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT $REGPATH = "HKCR:\" Get-ChildItem "$REGPATH" Hive: HKEY_CLASSES_ROOT Name Property
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
$REGPATH = "HKCR:\"
Get-ChildItem "$REGPATH"
Hive: HKEY_CLASSES_ROOT
Name Property
---- --------
* AlwaysShowExt :
ConflictPrompt : prop:System.ItemTypeText;System.Size;System.Date
Modified;System.DateCreated
ContentViewModeForBrowse : prop:~System.ItemNameDisplay;System.ItemTypeText
;~System.LayoutPattern.PlaceHol
der;~System.LayoutPattern.PlaceHolder;System.Dat
eModified;System.Size
ContentViewModeForSearch :
[....]
ss
AcroAccess.AcrobatAccess.1 (default) : AcrobatAccess Class
acrobat URL Protocol :
(default) : URL:Acrobat Protocol
acrobat2018 URL Protocol :
(default) : URL:Acrobat Protocol
我尝试将其筛选出来,只获取自定义方案,但没有得到好的结果:
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
$REGPATH = "HKCR:\"
Get-ChildItem "$REGPATH" | Where-Object {$_.Property -Match "^(default) : URL:.*"}
在这一点上,我认为这是最简单的方法:
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
$REGPATH = "HKCR:\"
Get-ChildItem "$REGPATH" >> temp.txt
Select-String -Path .\tmp.txt -Pattern 'URL:'