|
cmd脚本:
- @echo off
- SETLOCAL ENABLEDELAYEDEXPANSION
- rem 本脚本用于确定当前nt5以上框架工作站系统的级别版本和类型,需vbs/wmi 支持
- >%temp%\verx.vbs echo Set wmi=GetObject("winmgmts:\\.")
- >>%temp%\verx.vbs echo Set operation=wmi.instancesof(^"win32_Operatingsystem^")
- >>%temp%\verx.vbs echo For Each sys In operation
- >>%temp%\verx.vbs echo WScript.Echo sys.caption^&","^&sys.Version^&","^&sys.OSArchitecture
- >>%temp%\verx.vbs echo Next
- set "winver=Unkonw"
- for /f "skip=2 delims=, tokens=1,2,3" %%c in ('cscript "%temp%\verx.vbs"') do (
- echo %%c,%%d,%%e
- echo ===========================================================
- for /f "delims=. tokens=1,2" %%i in ("%%d") do (
- if %%i.%%j equ 10.0 set "winver=Win_10"
- if %%i.%%j equ 6.2 set "winver=Win_8"
- if %%i.%%j equ 6.1 set "winver=Win_7"
- if %%i.%%j equ 6.0 set "winver=Win_Vista"
- if %%i.%%j equ 5.2 set "winver=Win_XP"
- if %%i.%%j equ 5.1 set "winver=Win_XP"
- if %%i.%%j equ 5.0 set "winver=Win_2K"
- )
- for /f "delims=- tokens=1" %%i in ("%%e") do (
- set "winver=!winver!.%%i"
- if %%i equ 32 set "winver=!winver:.%%i=.x86!"
- if %%i equ 64 set "winver=!winver:.%%i=.x64!"
- )
- )
- echo !winver!
复制代码
|
|