Skip to content

[Feat]: win11系统右键菜单“新建”项目“BMP 图像”被遗漏 #122

Description

@mmm520109

Checklist

  • This feature has not already been requested (search here)
  • The latest version of ContextMenuManager does not include this feature
  • I understand: general ideas (not specific features) should be posted in Discussions

Summary

[Feat]: win11系统右键菜单“新建”项目“BMP 图像”被遗漏,希望添加该项目的管理

Details

意思就是删除win11系统的右键菜单中的“新建”项目里面的“BMP 图像”
该新建项目好像是由画图构建的,非常顽固,一般手段删除不了。

$cachePath = "HKCU:\Software\Classes\Local Settings\MrtCache"

在缓存目录中遍历搜索顽固的 BMP 新建项

Get-ChildItem -Path $cachePath -Recurse -ErrorAction SilentlyContinue | ForEach-Object {
$key = $_
$props = Get-ItemProperty -Path $key.PSPath -ErrorAction SilentlyContinue

foreach ($p in $props.PSObject.Properties) {
    # 只要键名包含 ShellNewDisplayName_Bmp 就将其数值清空
    if ($p.Name -match "ShellNewDisplayName_Bmp") {
        Set-ItemProperty -Path $key.PSPath -Name $p.Name -Value ""
        Write-Host "已成功找到并清空画图的 BMP 新建项!" -ForegroundColor Green
    }
}

}

Write-Host "正在重启资源管理器以使更改生效..." -ForegroundColor Yellow
Stop-Process -Name explorer -Force

方法一:一键自动清除脚本(推荐)
既然路径会动态变化,最优雅的办法就是用 PowerShell 让系统自己去 MrtCache 里找,找到并强制清空它。

右键点击底部的“开始”徽标,选择 “终端(管理员)” 或 “Windows PowerShell(管理员)”。

将下面这段代码完整复制,并粘贴到窗口中,然后按下回车键(Enter):

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions