807979023 发表于 2018-10-28 16:15:29

查看多系统版本位数

本帖最后由 807979023 于 2018-10-29 19:38 编辑

查看多系统版本位数,可在正常系统或pe中运行。
@echo off
color 1f
echo.
echo.
echo 查看多系统版本位数:
echo.
setlocal enabledelayedexpansion
for %%i in (C D E F G H I J K L M N O P Q R S T U V W) do (
   if exist "%%i:\Windows\explorer.exe" (
      if /i not exist "%%i:\windows\syswow64" (
         set vx=x86
      ) else (
         set vx=x64
      )
      echo.
      set vc=0
      set load=0
      if exist "%%i:\Windows\System32\winload.exe" set load=1
      if exist "%%i:\Windows\System32\boot\winload.exe" set load=1
      if "!load!" == "0" (
         if exist "%%i:\Windows\WinSxs\*.3790.*" echo %%i盘 win2003 !vx! && set vc=1
         if not exist "%%i:\Windows\WinSxs\*.3790.*" echo %%i盘 winxp !vx! && set vc=1
      )
      if exist "%%i:\Windows\WinSxs\*.7600.*" echo %%i盘 win7 !vx! && set vc=1
      if exist "%%i:\Windows\WinSxs\*.9200.*" echo %%i盘 win8 !vx! && set vc=1
      if exist "%%i:\Windows\WinSxs\*.9600.*" echo %%i盘 win8.1 !vx! && set vc=1
      if "!vc!" == "0" echo %%i盘 win10 !vx!
   )
)
for /f "tokens=1* delims=[" %%a in ('ver') do set b=%%b
set b=%b:* =%
set b=%b:~0,3%
if /i not exist "%windir%\syswow64" (
   set d=x86
) else (
   set d=x64
)
if /i %SystemDrive% == x: (
   echo.
   if "%b%" == "5.1" echo x盘 winxp %d%
   if "%b%" == "5.2" echo x盘 win2003 %d%
   if "%b%" == "6.1" echo x盘 win7 %d%
   if "%b%" == "6.2" echo x盘 win8 %d%
   if "%b%" == "6.3" echo x盘 win8.1 %d%
   if "%b%" == "10." echo x盘 win10 %d%
)
pause >nul

dhlxtynz 发表于 2018-10-28 17:51:05

感谢分享,位数没错,操作系统检测不对!

807979023 发表于 2018-10-28 18:14:54

dhlxtynz 发表于 2018-10-28 17:51
感谢分享,位数没错,操作系统检测不对!

已修改,再试-下。

nttwqz 发表于 2018-10-28 20:42:18

在任意一个分区新建一个空白的Windows文件夹,就会被判断为winxp x86...

807979023 发表于 2018-10-29 08:23:43

if exist "%%i:\Windows" (      已改为      if exist "%%i:\Windows\explorer.exe" (

窄口牛 发表于 2018-10-29 09:30:47

挂载注册表判断,论坛有现成的。

qxhdly 发表于 2018-10-29 17:26:32

感谢分享,

ba21 发表于 2019-5-18 15:08:48

huang1987 发表于 2023-11-13 07:55:48

谢谢分享

boaz199 发表于 2023-11-16 13:28:55

頂,謝謝樓主的勞動和分享!數據會記錄每個信息對網絡的奉獻!
页: [1]
查看完整版本: 查看多系统版本位数