find out user's windows
Posted: 27 Jan 2011 05:40
how to find out user's windows in batch?
if xp echo "you have windows xp"
else echo "you have another windows"
if xp echo "you have windows xp"
else echo "you have another windows"
Code: Select all
for /f "tokens=2 delims=[]" %%a in ('ver') do set winver=%%a
if "%winver%"=="Version 5.1.2600" (
echo.This is Windows XP
) else (
echo.This is another version of windows.
)
Code: Select all
ver|findstr /c:"5.1.2600" && echo.windows xp || echo.not XP
Code: Select all
@echo off &setlocal
for /f "tokens=1,2*" %%a in ('reg Query "HKLM\Software\Microsoft\Windows NT\CurrentVersion"') do (
if /i "%%a"=="CurrentBuildNumber" set "build=%%c"
if /i "%%a"=="CurrentVersion" set "version=%%c"
if /i "%%a"=="ProductName" set "name=%%c"
)
echo %build%
echo %version%
echo %name%
pause