PE里确定系统版本 求助一个变量调用问题 for 里面
问题在第 19-22行的代码位置
请大神们指教,优化代码
谢谢- @echo off
- setlocal enabledelayedexpansion
-
- set "$5.1.26=WinXP"
- set "$5.2.00=WinXP 64 "
- set "$6.0.60=Vista /S2008 "
- set "$6.1.76=Win7 /S2008 R2"
- set "$6.2.92=Win8 /S2012 "
- set "$6.3.96=Win8.1/S2012R2 "
- set "$10.0.1=Win10 /S2016-9 "
- set "$10.0.2=Wind11/S2022 "
-
- :: 遍历磁盘,确定盘符占用,并返回系统版本
- for %%a 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 (
- if exist %%a:\ (
- if exist "%%a:\windows\system32\version.dll" (
- echo %%a
- for /f "tokens=2 delims==" %%b in ('wmic datafile where Name^="%%a:\\Windows\\explorer.exe" get Version /value') do (
- call echo %%b
- set "tmp=%%b"
- set "x=!tmp:~0,6!"
- set "xx=$!x!"
- )
- for /f "tokens=2 delims==" %%b in ('wmic datafile where Name^="%%a:\\Windows\\System32\\version.dll" get Version /value') do (call echo %%b)
- if exist "%%a:\boot\memtest.ext" (echo BIOS) else (echo UEFI)
- )
- )
- )
-
-
- echo !x!
- echo !xx!
-
- echo --------------
-
- set
-
- PAUSE>NUL
复制代码
|