bat批处理文件自动判断系统版本信息(转载)


@echo off
ver|find "Version 5.0" >nul
if not errorlevel 1 goto Windows2K
ver|find "版本 5.0" >nul
if not errorlevel 1 goto Windows2K
ver|find "Version 5.1" >nul
if not errorlevel 1 goto WindowsXP
ver|find "版本 5.1" >nul
if not errorlevel 1 goto WindowsXP
ver|find "Version 5.2" >nul
if not errorlevel 1 goto Windows2K3
ver|find "版本 5.2" >nul
if not errorlevel 1 goto Windows2K3
ver|find "Version 6.0" >nul
if not errorlevel 1 goto WindowsVista
ver|find "版本 6.0" >nul
if not errorlevel 1 goto WindowsVista
ver|find "Version 6.1" >nul
if not errorlevel 1 goto Windows7
ver|find "版本 6.1" >nul
if not errorlevel 1 goto Windows7
(echo Not support this Operating System.)
goto eof
:Windows2K
echo Windows2K
goto eof
:Windows2K3
echo Windows2K3
goto eof
:WindowsXP
echo WindowsXP
goto eof
:WindowsVista
echo WindowsVista
goto eof
:Windows7
if /i "%PROCESSOR_IDENTIFIER:~0,3%"=="X86" (goto X86) else (goto X64)
:X86
echo Windows7 X86
goto eof
:X64
echo Windows7 X64
goto eof
:eof
pause
exit

posted @ 2013-10-27 00:14  dzqabc  阅读(2769)  评论(0编辑  收藏  举报