|
貌似蛮多方法都能实现。
ver
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion"|find /i "productname"
systeminfo|find /i "os 名称"
wmic os get name
仅以reg query为例:
---------------------分割线----------------------
@echo off&setlocal enabledelayedexpansion
set "aa=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
for /f "delims=" %%a in ('reg query "!aa!"^|find /i "productname"') do (
set "str=%%a"
if not "!str:xp=!"=="!str!" set "systype=nt5x"
if not "!str:2003=!"=="!str!" set "systype=nt5x"
if not "!str:vista=!"=="!str!" set "systype=nt6x"
if not "!str:2008=!"=="!str!" set "systype=nt6x"
if not "!str:7=!"=="!str!" set "systype=nt6x"
)
echo !systype!
pause
---------------------分割线---------------------- |
|