Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Windows 綜合教學 >> 系統最佳化

畸形檔案刪不掉?一個 .bat 腳本搞定

編輯:系統最佳化

檔名亂碼、權限錯誤、系統判定不存在卻佔空間的畸形檔案,用批次檔繞過系統限制強制刪除:

建立刪除腳本 del.bat

  1. 記事本新增檔案,貼入:
    DEL /F /A /Q \\?\%1
    RD /S /Q \\?\%1
  2. 另存新檔:檔案類型選「所有檔案」,檔名 del.bat (必須 .bat 副檔名)。

使用方法

將頑固檔案/資料夾**拖曳到 del.bat 圖示上**,瞬間刪除。

原理解析

  • \\?\ 前綴 → 告訴 Windows 使用 **NT 物件管理器路徑**,繞過 260 字元限制、解析特殊字元、直接操作檔案系統物件。
  • DEL /F /A /Q → 強制刪除唯讀/隱藏/系統檔、不提示確認。
  • RD /S /Q → 遞歸刪除資料夾及內容、不提示。

這招對付絕大多數畸形檔案/資料夾屢試不爽,收藏備用。

Copyright © Windows教程網 All Rights Reserved