删除D盘下system volume information文件夹。

📅 发布时间:2026/7/6 19:20:12 👁️ 浏览次数:
删除D盘下system volume information文件夹。
# PowerShell脚本删除System Volume Information文件夹 # 作者Assistant # 日期2026-03-07 # 说明此脚本用于在Windows系统中删除System Volume Information文件夹 # 注意需要以管理员权限运行此脚本 # 设置变量 $folderPath D:\System Volume Information # 检查文件夹是否存在 if (Test-Path $folderPath) { Write-Host 正在删除System Volume Information文件夹... -ForegroundColor Yellow # 获取所有权 Write-Host 获取文件夹所有权... -ForegroundColor Green takeown /f $folderPath /r /d Y # 授予完全控制权限 Write-Host 授予完全控制权限... -ForegroundColor Green icacls $folderPath /grant administrators:F /t # 删除文件夹 Write-Host 执行删除操作... -ForegroundColor Red Remove-Item -Path $folderPath -Recurse -Force -Confirm:$false # 检查是否删除成功 if (!(Test-Path $folderPath)) { Write-Host 成功删除System Volume Information文件夹。 -ForegroundColor Green } else { Write-Host 删除失败请检查权限或文件是否被占用。 -ForegroundColor Red } } else { Write-Host System Volume Information文件夹不存在。 -ForegroundColor Yellow }