求大佬帮忙修改个删除注册表的代码
[PowerShell] 纯文本查看 复制代码chcp 65001
rem 首先,通过下面的命令,手动生成几个uuid,比如笔者生成了5个
rem 当然,这里只是要生产uuid,并不限制工具,大小写可能也不限制,只是保持跟windows风格一致
rem uuidgen.exe的路径可能跟笔者的不一样,可以换成自己电脑上的路径
rem 生成一批uuid,-h帮助,-c大写,-n5生成5个
rem "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\uuidgen.exe" -c -n5
rem 生成的uuid这里做个备份,习惯而已(下面展示的随机的并不是真正的id)
rem XXXXXXX1-XXXX-XXXX-XXXX-XXXXXXXXXXXX
rem XXXXXXX2-XXXX-XXXX-XXXX-XXXXXXXXXXXX
rem XXXXXXX3-XXXX-XXXX-XXXX-XXXXXXXXXXXX
rem XXXXXXX4-XXXX-XXXX-XXXX-XXXXXXXXXXXX
rem XXXXXXX5-XXXX-XXXX-XXXX-XXXXXXXXXXXX
rem 设置3个变量
set custom_clsid=26c124d9-7ef3-91e0-eb9a-20f11c277693
set custom_show_name=Docs
set custom_directory=D:\Backups\Docs
rem 下面的命令就不用改了
rem Step 1: Add your CLSID and name your extension
reg add HKCU\Software\Classes\CLSID\{%custom_clsid%} /ve /t REG_SZ /d %custom_show_name% /f
rem Step 2: Set the image for your icon
reg add HKCU\Software\Classes\CLSID\{%custom_clsid%}\DefaultIcon /ve /t REG_EXPAND_SZ /d %%SystemRoot%%\system32\imageres.dll,-102 /f
rem Step 3: Add your extension to the Navigation Pane and make it visible
reg add HKCU\Software\Classes\CLSID\{%custom_clsid%} /v System.IsPinnedToNameSpaceTree /t REG_DWORD /d 0x1 /f
rem Step 4: Set the location for your extension in the Navigation Pane
reg add HKCU\Software\Classes\CLSID\{%custom_clsid%} /v SortOrderIndex /t REG_DWORD /d 0x42 /f
rem Step 5: Provide the dll that hosts your extension
reg add HKCU\Software\Classes\CLSID\{%custom_clsid%}\InProcServer32 /ve /t REG_EXPAND_SZ /d %%systemroot%%\system32\shell32.dll /f
rem Step 6: Define the instance object
reg add HKCU\Software\Classes\CLSID\{%custom_clsid%}\Instance /v CLSID /t REG_SZ /d {0E5AAE11-A475-4c5b-AB00-C66DE400274E} /f
rem Step 7: Provide the file system attributes of the target folder
reg add HKCU\Software\Classes\CLSID\{%custom_clsid%}\Instance\InitPropertyBag /v Attributes /t REG_DWORD /d 0x11 /f
rem Step 8: Set the path for the sync root
reg add HKCU\Software\Classes\CLSID\{%custom_clsid%}\Instance\InitPropertyBag /v TargetFolderPath /t REG_EXPAND_SZ /d %custom_directory% /f
rem Step 9: Set appropriate shell flags
reg add HKCU\Software\Classes\CLSID\{%custom_clsid%}\ShellFolder /v FolderValueFlags /t REG_DWORD /d 0x28 /f
rem Step 10: Set the appropriate flags to control your shell behavior
reg add HKCU\Software\Classes\CLSID\{%custom_clsid%}\ShellFolder /v Attributes /t REG_DWORD /d 0xF080004D /f
rem Step 11: Register your extension in the namespace root(关键命令:显示到左侧导航栏)
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{%custom_clsid%} /ve /t REG_SZ /d %custom_show_name% /f
rem Step 12: Hide your extension from the Desktop(关键命令:隐藏桌面上多出的图标)
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel /v {%custom_clsid%} /t REG_DWORD /d 0x1 /f