- Как посмотреть версию операционной системы Windows
- Из командной строки (универсальный)
- Не загружаясь
- В графической оболочке
- Windows 10
- Windows 8
- Windows 7
- Find windows OS version from command line
- Find OS Version and Service Pack number from CMD
- Check Windows version using WMIC command
- how to tell what version of windows and/or cmd.exe a batch file is running on?
- 8 Answers 8
- Как узнать версию ОС?
- Решение
- How to get Windows version from command prompt or from PowerShell
- 6 Answers 6
Как посмотреть версию операционной системы Windows
Из командной строки (универсальный)
Универсальный способ узнать версию вашей Windows — открыть командную строку (Win + R — cmd) и ввести следующее:
Результат будет, примерно, следующий:
* в данном примере Windows 10 Professional, версия сборки 10.0.10586, 64-х разрядная.
Не загружаясь
Не загружая до конца операционную систему можно определить только ее выпуск по логотипу загрузки:
* как видно, Windows 8 и 10 имеют одинаковые окна при загрузке, поэтому точность определения низкая.
В графической оболочке
В зависимости от выпуска операционной системы версия Windows смотрится немного по-разному.
Windows 10
Нажимаем Пуск — Параметры:
Кликаем по Система:
Переходим в раздел О системе:
Справа отобразится версия Windows 10:
Windows 8
Кликаем по Пуск:
* В Windows 8.0 кнопки «Пуск» не видно. Чтобы на нее нажать, нужно навести указатель точно в левый нижний угол экрана и кликнуть левой кнопкой мыши.
Теперь по стрелке вниз:
В строке поиска начинаем писать «сведения»:
Среди результатов кликаем по Сведения о системе:
В открывшемся окне мы увидим версию Windows 8:
Windows 7
Нажимаем по Пуск — Все программы:
Переходим в Стандартные:
Служебные:
Выбираем Сведения о системе:
В открывшемся окне мы увидим версию Windows 7:
Find windows OS version from command line
Windows has command line utilities that show us the version of the Windows OS running on the computer, including the service pack number. There are multiple CMD commands that help with finding this, you can pick the one that suits your need. Ver command can show you the OS version whereas Systeminfo command can additionally give you service pack, OS edition and build number etc.
Find OS Version and Service Pack number from CMD
As you can see above, ver command shows only OS version but not the service pack number. We can find service pack number as well with Systeminfo command. Systeminfo dumps lot of other information too, which we can filter out using findstr command.
This command works on XP, Vista and Windows 7 and on Server editions also. Find below example for Win7.
In case of Windows 7 SP1, the output would be slightly different as below.
If you want to print more details, then you can use just ‘OS’ in the findstr search pattern. See example below for Server 2008.
Check Windows version using WMIC command
Run the below WMIC command to get OS version and the service pack number.
Example on Windows 7:
If you want to find just the OS version, you can use ver command. Open command window and execute ver command. But note that this does not show service pack version.
This command does not show version on a Windows 7 system.
how to tell what version of windows and/or cmd.exe a batch file is running on?
How can one determine what version of Windows and/or cmd.exe a batch file is running on?
There is no cmd /version that I’ve been able to find and the results of SET in a command prompt session don’t give anything obviously unique (between XP and Win7 anyway).
8 Answers 8
The version of cmd.exe should actually be pretty irrelevant, unless you try to use features that didn’t exist before (in command.com for example). There is the pseudovariable
which holds the version of the command extensions which has been 2 for ages (at least back to NT 4, iirc).
But, back to the point: Running ver and parsing the version string might be your best bet:
you can use the «systeminfo» @ cmd.exe
I found a shorter way using ver as well:
Could be even shorter:
I found a shorter way using ver as well:
This will find XP, replace the string with your wanted versions
Type «ver» at a command prompt.
Next time around, since this isn’t really programming related but server or user related, you might try serverfault.com or superuser.com.
To find the windows version using WMIC you can use:
Maybe someone will need the following to determine the SKU (Win7). I’m using some of this script to pick the right OS and XML during sysprep. Hope it helps!
The internal command ver reports windows version number (which could have been learned by typing help at the command prompt).
There is a dynamic variable %CMDEXTVERSION% , but it hasn’t progressed in several releases so it’s only useful for delineating between Windows NT and Windows 2000 and newer. (Thanks @Joey, here.)
Here’s a batch to parse the output of ver for XP and newer, courtesy of Simon Sheppard:
And here’s my own fairly complete, largely academic, kick at the can which returns the parsed version number as environment variables:
Как узнать версию ОС?
Как узнать версию и разрядность ОС?
собствено как это узнать средствами CMD
Как узнать версию веб-сервера Telnetом?
Добавлено через 8 минут может как-то через ssh?
Как узнать версию драйвера с помощью DevCon?
Здравствуйте! Подскажите как можно узнать версию драйвера через devcon
Как узнать версию ОС и выдать нужный файл исходя из этого?
Здравствуйте форумчане, нужна помощь.У меня есть софт который работает либо на win 32 bit либо win.
И не приведёт к тому, что Вы хотели увидеть.
Просто надо использовать такие соответствия:
Решение
Smitis, нельзя. По крайней мере, потому что в Windows XP и Vista такой переменной нет.
Kotya, смотрите внимательно по ссылкам, которые я давал.
Там определение разрядности и системы, и процесса.
В данном случае, логика такая:
Environment Variable\Program Bitness | 32bit Native | 64bit Native | WOW64 |
---|---|---|---|
PROCESSOR_ARCHITECTURE | x86 | AMD64 | x86 |
PROCESSOR_ARCHITEW6432 | undefined | undefined | AMD64 |
WOW64 = 32bit программа на 64bit ОС.
А, ссорри, понял, нет в WinXP64.
Добавлено через 12 минут
Но тем не менее остаётся вариант проверки ProgramFiles(x86)
Вот перевод заметки автора к этому коду:
1. Использование команды SYSTEMINFO, не полагаясь на команды VER, объясняется тем, что Windows Server 2008 «делит» номера версий с другими релизами Windows (см. Microsoft).
Таким образом, попытка обнаружить машину с Windows Vista или Windows 7, опираясь на «номер версии» 6.0 или 6.1 не приведет к успеху, так как не удастся отличить их от машин с Windows Server 2008 или Windows Server 2008 R2
2. Создание %Temp%\osname.txt оказалось необходимым потому, что я не смог передать результаты SYSTEMINFO | find «OS Name» непосредственно в команду for /f — это не похоже на команду перенаправления (piping). Вы можете найти более простой способ использовать информацию из SYSTEMINFO — если удастся, то, пожалуйста, оставьте комментарий.
3. Переменная среды %vers% имеет наибольший приоритет. Я мог удалить её при помощи более объемного пакетного файла, но в текущей задаче — это лишнее.
4. Пакетный файл ищет SystemInfo согласно своим инструкциям, и если он эту утилиту не обнаруживает в тех директориях, которые определены для самой старой, указанной в файле версии ОС, то это означает, что версия запущенной Windows, ещё старше, и утилита не будет использована. В 64-битной Windows7 SystemInfo по-прежнему находится в папке %SystemRoot%\system32 — если более поздние версии Windows, будут только 64-разрядными, то данный пакетный файл, возможно, придется обновить.
SrgKord, да-да. Наступали на эти грабли.
А еще XPx64 и 2003 тоже одинаковые индексы.
How to get Windows version from command prompt or from PowerShell
But is there a way to get the exact version string using command line output similar to the one mentioned in the image?
The attached is the output of «winver» command from run. PS: I am looking for a batch or PowerShell command.
There are some alternates available to get the Windows version like this PowerShell command:
6 Answers 6
The following commands are is going to help you with that. If you need more information, just type in systeminfo:
The ver command shows something like this:
But in PowerShell (or Git Bash) you have to call it through the cmd command:
I found it somewhere, PowerShell:
To add to @Bonifacio ‘s answer:
Would be even better, because it returns only the ReleaseId value, which you could then pipe to a file. Especially useful if you have several hosts to deal with.
With system information you can only get the build with that value and go to Google to get the respective version.
However, one simple way is by searching the registry on the command line:
The reg query way suggested all output a little garbage.
Using a for loop with tokens will output clean information.
The tokens=3 refers to the third word from the original output.
You will need to double the % if running inside a bat file.
You can set the output as a variable by replacing echo %i with set build=%i
Also remember to escape ^ any special characters.
Lastly look at HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion for the string that has the required value. You may need to adjust the token count.