本帖最后由 pcl_test 于 2015-9-28 10:22 编辑
- @echo off&setlocal enabledelayedexpansion
- set "硬件=Microsoft Hosted Network Virtual Adapter"
- set "tmppath=HKLM\SYSTEM\CurrentControlSet\Enum"
- echo;searching……
- for /f "delims=" %%a in ('reg query "%tmppath%" /f "%硬件%" /d /s^|findstr /i "HKEY_LOCAL_MACHINE"') do (
- set "regpath=%%a"
- if defined regpath goto :0
- )
- :0
- for /f "tokens=2*" %%a in ('reg query "%regpath%" /v HardwareID /se 、^|findstr /i "HardwareID"') do (
- set "id=%%b"
- set "id=!id:&=^&!"
- )
- echo;%id%
- pause
复制代码
|