利用devcon工具編寫bat腳本一鍵控制系統設備,如開啟關閉網卡


系統WIN7 x64位

下載devcon命令行工具

  1. Download the “Windows Driver Kit (WDK) 7.1.0 from Microsoft: http://www.microsoft.com/download/en/details.aspx?id=11800
  2. Extract the ISO to a temp directory with WinRAR, Uniectractor
  3. Extract the install file “WDK\setuptools_x64fre.msi” to a temp directory, where you will find “WinDDK\7600.16385.win7_wdk.100208-1538\tools\devcon\amd64\devcon.exe”
  4. 將devcon 復制到 C:\Windows\System32
  • 注意: devcon MUST be run from an administrator cmd win *

查找網卡設備信息

  1. 使用管理員運行cmd
  2. 列出全部的PCI設備信息
    devcon find PCI\*
  3. 記下網卡的信息,如

PCI\VEN_8086&DEV_15B7&SUBSYS_06B91028&REV_31\3&11583659&0&FE: Intel(R) Ethernet Connection (2) I219-LM

編寫bat腳本

@echo off
devcon enable *DEV_15B7*
echo on
@echo off
devcon disable *DEV_15B7*
echo on


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM