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

Win7 批次檔一鍵啟用/停用無線網卡,devcon 指令搭配硬體 ID 自動化

編輯:Win7 常見問題解答

Windows 7 可使用 Microsoft 提供的 devcon.exe 命令列工具,搭配無線網卡硬體 ID,撰寫批次檔實現一鍵啟用/停用無線網卡。

準備工作

  1. 確認系統有 devcon.exe (通常在 C:\Windows\System32),無則至 Microsoft 官網下載:
    https://download.microsoft.com/download/1/1/f/11f7dd10-272d-4cd2-896f-9ce67f3e0240/devcon.exe
    解壓後放入 System32 目錄。
  2. 取得無線網卡硬體 ID:
    右鍵「電腦」→「管理」→「裝置管理員」→「網路介面卡」→ 右鍵目標無線網卡 →「內容」→「詳細資料」→「屬性」選「硬體識別碼」→ 複製第一行值 (如 PCI\VEN_14E4&DEV_4365&CC_0280)。

撰寫批次檔

桌面新建文字文件,另存為 禁用無線網卡.bat 與 啟用無線網卡.bat,內容如下:

:: 禁用無線網卡.bat
@echo off
devcon disable *PCI\VEN_14E4&DEV_4365&CC_0280*
echo on

:: 啟用無線網卡.bat
@echo off
devcon enable *PCI\VEN_14E4&DEV_4365&CC_0280*
echo on

將星號間的硬體 ID 替換為實際值,雙擊對應批次檔即可切換網卡狀態,適合製作捷徑或排程自動化控制。

Copyright © Windows教程網 All Rights Reserved