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

Win7 批次檔開啟/關閉無線網卡,devcon 指令自動化控制

編輯:Win7 系統應用技巧

需頻繁開關無線網卡(如切換有線/無線),用 devcon 指令寫批次檔一鍵操作。

準備與步驟

  1. 確認 devcon.exe 存在(C:\Windows\System32 或微軟官網下載放入)。
  2. 取得無線網卡硬體 ID:
    「電腦」右鍵→「管理」→「裝置管理員」→ 無線網卡右鍵→「內容」→「詳細資料」→「硬體 ID」記錄(如 PCI/VEN_14E4&DEV_4365&CC_0280)。
  3. 建立兩個 .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

    批次檔內容
  4. 雙擊執行即可開關無線網卡,可建立捷徑指定熱鍵或排程自動執行。

同法適用於任何裝置(網卡、聲卡、USB 控制器等),只需更換硬體 ID。

Copyright © Windows教程網 All Rights Reserved