This is the mail archive of the
mailing list for the Cygwin project.
Re: is there a (cygwin?) method delivering the current version of windows?
- From: Yitzchak Scott-Thoennes <sthoenna at efn dot org>
- To: cygwin at cygwin dot com
- Date: Mon, 24 Jan 2005 03:12:08 -0800
- Subject: Re: is there a (cygwin?) method delivering the current version of windows?
- Organization: bs"d
- References: <41F4B046.firstname.lastname@example.org>
On Mon, Jan 24, 2005 at 09:22:30AM +0100, H. Henning Schmidt wrote:
> Hi all,
> I am looking for a method available to my cygwin'ed C-program that
> delivers the current version of windows that my program is running on.
> E.g. "WinXp, SP1", or "Win98 ..." (... you get the idea ...) either in
> textual or numerically encoded form.
> Any hint is appreciated. Thanks,
There's probably a much easier way, but:
$ perl -wle'print for Win32::GetOSVersion'
Service Pack 1
[CORE] Returns the list (STRING, MAJOR, MINOR, BUILD, ID), where
the elements are, respectively: An arbitrary descriptive string,
the major version number of the operating system, the minor ver-
sion number, the build number, and a digit indicating the actual
operating system. For the ID, the values are 0 for Win32s, 1 for
Windows 9X/Me and 2 for Windows NT/2000/XP/2003. In scalar con-
text it returns just the ID.
Currently known values for ID MAJOR and MINOR are as follows:
OS ID MAJOR MINOR
Win32s 0 - -
Windows 95 1 4 0
Windows 98 1 4 10
Windows Me 1 4 90
Windows NT 3.51 2 3 51
Windows NT 4 2 4 0
Windows 2000 2 5 0
Windows XP 2 5 1
Windows Server 2003 2 5 2
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html