隐藏“这台电脑”中上方显示的7个文件夹以及左侧导航栏对应的链接

in Windows with 0 comment

此批处理文件的功能:

使用方法

  1. 新建一个txt文件
  2. 将以下代码全部粘贴、保存
  3. 把后缀txt重命名为bat(例如a.txt改为a.bat)
  4. 双击执行即可
@echo off
rem By XCP 20190630

rem --------获取管理员权限--------
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
rem --------获取管理员权限--------

cls
echo.
echo.此批处理文件能够隐藏“这台电脑”中上方显示的7个文件夹,同时左侧导航栏对应的7个链接也会被隐藏(非快速访问)
echo.
echo.
echo ----------------------1、输入数字1并按回车,隐藏文件夹----------------------
echo.
echo ----------------------2、输入数字2并按回车,显示文件夹----------------------
echo.
echo.
echo 请选择要执行的操作:
set /p num=

if "%num%"=="1" (
echo 图片文件夹
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag /v ThisPCPolicy /t REG_SZ /d Hide /f
echo.
echo 视频文件夹
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag /v ThisPCPolicy /t REG_SZ /d Hide /f
echo.
echo 下载文件夹
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag /v ThisPCPolicy /t REG_SZ /d Hide /f
echo.
echo 音乐文件夹
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag /v ThisPCPolicy /t REG_SZ /d Hide /f
echo.
echo 桌面文件夹
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{b4bfcc3a-db2c-424c-b029-7fe99a87c641}\PropertyBag /v ThisPCPolicy /t REG_SZ /d Hide /f
echo.
echo 文档文件夹
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag /v ThisPCPolicy /t REG_SZ /d Hide /f
echo.
echo 3D对象文件夹
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag /v ThisPCPolicy /t REG_SZ /d Hide /f
echo.
taskkill /f /im explorer.exe & start explorer.exe
pause
)

if "%num%"=="2" (
echo 图片文件夹
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag /v ThisPCPolicy /t REG_SZ /d Show /f
echo.
echo 视频文件夹
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag /v ThisPCPolicy /t REG_SZ /d Show /f
echo.
echo 下载文件夹
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag /v ThisPCPolicy /t REG_SZ /d Show /f
echo.
echo 音乐文件夹
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag /v ThisPCPolicy /t REG_SZ /d Show /f
echo.
echo 桌面文件夹
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{b4bfcc3a-db2c-424c-b029-7fe99a87c641}\PropertyBag /v ThisPCPolicy /t REG_SZ /d Show /f
echo.
echo 文档文件夹
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag /v ThisPCPolicy /t REG_SZ /d Show /f
echo.
echo 3D对象文件夹
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag /v ThisPCPolicy /t REG_SZ /d Show /f
echo.
taskkill /f /im explorer.exe & start explorer.exe
pause
)