|
遍历代码写好了,整合一下就可以了
- @echo off
- echo 正在查找使用过网卡的系统盘符...
- set "found=0"
- set "driveCount=0"
- set "firstDrive="
- for %%d in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
- ::echo 正在搜索盘符 %%d...
- dir /s /b "%%d:\Program Files (x86)\Inno Setup 5\ISCrypt.dll" > nul 2>&1
- if not errorlevel 1 (
- set /a "driveCount+=1"
- echo 已找到盘符 %%d
- set "found=1"
- if not defined firstDrive (
- set "firstDrive=%%d"
- )
- )
- )
- if %found%==0 (
- echo 未找到使用过网卡的系统盘符!
- pause
- ) else if %driveCount%==1 (
- goto :one
- ) else (
- goto :two
- )
- :one
- echo 找到1个盘符 %firstDrive%,现在开始查询...
- pause
- exit
- :two
- echo 找到多个盘符,请输入要查询的盘符,默认为第1个盘符 %firstDrive%
- pause
- exit
复制代码
|
|