feat(scripts): 资源管理器右键菜单

- install-explorer-menu.ps1:注册 HKCU 右键项(文件夹 / 文件夹空白处 / mkv,mp4,avi 文件)
- uninstall-explorer-menu.ps1:一键移除
- explorer-media-rename.ps1:菜单入口,文件取其所在目录,结束后可选暂停窗口
- media-rename.ps1:支持 MEDIA_RENAME_DRYRUN=1 环境变量,便于验证
This commit is contained in:
ali
2026-11-17 12:26:48 +08:00
parent 4fb2ac7c0b
commit 66f399dbed
4 changed files with 141 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
#Requires -Version 7.0
<#
.SYNOPSIS
移除 install-explorer-menu.ps1 注册的右键菜单。
.EXAMPLE
.\uninstall-explorer-menu.ps1
#>
[CmdletBinding()]
param()
$ErrorActionPreference = 'Stop'
$keys = @(
'HKCU:\Software\Classes\Directory\shell\SceneRename',
'HKCU:\Software\Classes\Directory\Background\shell\SceneRename',
'HKCU:\Software\Classes\SystemFileAssociations\.mkv\shell\SceneRename',
'HKCU:\Software\Classes\SystemFileAssociations\.mp4\shell\SceneRename',
'HKCU:\Software\Classes\SystemFileAssociations\.avi\shell\SceneRename'
)
$removed = 0
foreach ($key in $keys) {
if (Test-Path -LiteralPath $key) {
Remove-Item -LiteralPath $key -Recurse -Force
$removed++
Write-Host " - 已移除 $key" -ForegroundColor DarkGray
}
}
Write-Host "✔ 右键菜单已清理($removed 项)" -ForegroundColor Green