Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Win7 刪除 USB 隨身碟 autorun.inf 病毒?批次檔一鍵掃除全盤 autorun.* 完整教學

編輯:Win7 系統應用技巧

USB 隨身碟中毒產生 autorun.inf + 惡意執行檔,雙擊隨身碟即觸發感染。製作批次檔 u.bat 掃除全盤 autorun.*:新建文字文件 → 貼入掃毒碼 → 存為 u.bat → 顯示副檔名 → 雙擊執行(允許安全軟體攔截)→ 完成掃除。

製作掃毒批次檔

  1. 新建文字文件,貼入以下程式碼:
@echo on
taskkill /im explorer.exe /f
taskkill /im w.exe
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v ShowSuperHidden /t REG_DWORD /d 1 /f
reg import kill.reg
del c:\autorun.* /f /q /as
del %SYSTEMROOT%\system32\autorun.* /f /q /as
del d:\autorun.* /f /q /as
del e:\autorun.* /f /q /as
del f:\autorun.* /f /q /as
del g:\autorun.* /f /q /as
del h:\autorun.* /f /q /as
del i:\autorun.* /f /q /as
del j:\autorun.* /f /q /as
del k:\autorun.* /f /q /as
del l:\autorun.* /f /q /as
start explorer.exe
  1. 另存為 u.bat(副檔名必須為 .bat)。
  2. 資料夾選項 → 檢視 → 取消勾選「隱藏已知檔案類型的副檔名」→ 確定(確認副檔名顯示為 .bat)。
  3. 插入隨身碟 → 雙擊 u.bat 執行(安全軟體提示選「允許」)。

新建文字文件

重命名為 u.bat

顯示副檔名設定

程式碼解析

  • taskkill /im explorer.exe /f:結束 Explorer 釋放檔案鎖定。
  • reg add ... ShowSuperHidden=1:顯示超級隱藏檔(autorun.inf 常設為系統+隱藏)。
  • del X:\autorun.* /f /q /as:強制刪除各磁碟根目錄所有 autorun.*(含 .inf、.exe、.bat 等變體),/as 針對系統/隱藏屬性。
  • start explorer.exe:重啟 Explorer 恢復桌面。

現代防護建議

  • **關閉自動播放**:「自動播放」設定 → 取消勾選「對所有媒體和裝置使用自動播放」。
  • **開啟即時掃描**:Windows Defender / 第三方防毒軟體保持開啟。
  • **不隨意雙擊隨身碟**:「電腦」中右鍵隨身碟 → 「開啟」或「在新視窗開啟」。
  • **定期備份重要資料**:雲端 + 离線雙備份。
Copyright © Windows教程網 All Rights Reserved