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

Win7 系統執行 BAT 批次檔顯示亂碼該如何解決?另存為 ANSI 編碼修復

編輯:Win7 系統應用技巧

Windows 7 執行 .bat 批次檔出現中文亂碼,根因是檔案以 UTF-8 編碼儲存,而 CMD 預設代碼頁 936 (ANSI/GBK) 無法正確解讀。將檔案編碼轉為 ANSI 即可徹底解決。

修復步驟

  1. 右鍵 .bat 檔 → 「編輯」 (記事本開啟)。
  2. 「檔案」→「另存新檔」。
  3. 「編碼」選 ANSI → 「儲存」覆蓋。
  4. 查看儲存後檔案編碼已為 ANSI。
  5. 雙擊執行,亂碼問題解決。

原理:ANSI (代碼頁 936) 為 Win7 簡體中文系統預設編碼,CMD 原生支援;UTF-8 需 chcp 65001 且字型支援下才能顯示,不穩定。建議所有批次檔統一用 ANSI 編碼編寫儲存。

Copyright © Windows教程網 All Rights Reserved