Windows Server 2008 R2(64 位元)的 hosts 檔案位於 C:\Windows\System32\drivers\etc\hosts,因權限保護無法直接編輯。本文提供三種實用修改方案。
hosts 複製到桌面或其他可寫入位置。C:\Windows\System32\drivers\etc\hosts(檔案類型選「所有檔案」)。



@echo off
del %systemroot%\system32\drivers\etc\hosts
echo 127.0.0.1 www.test.com >>%systemroot%\system32\drivers\etc\hosts
start https://www.jb51.net
hosts.bat(確保顯示副檔名)。
以上方法同樣適用於 Windows 7/8/10 等需管理員權限修改系統檔案的情境。