How can I get the windows version I am currently running under Cygwin?
I am maintaining a automatic build script that is running on Mac, Windows and Linux distributions and I need to be able to detect what Windows version it is currently running under.
Preferably I could have it return the standard Windows release name but some kind of code that I can separate from the other ones would also be great.
What I want to know is if I am running 7, XP, Server 2008 and so on.
Help, Ideas?
The -c option checks the version and status of installed Cygwin packages. If you specify one or more package names, cygcheck will limit its output to those packages, or with no arguments it lists all packages. A package will be marked Incomplete if files originally installed are no longer present.
Cygwin is a collection of open source tools that allows Unix or Linux applications to be compiled and run on a Microsoft Windows operating system (OS) from within a Linux-like interface. Cygwin offers users a Linux-like experience in a Windows environment.
If you right-click on a . txt file and select "open with" you should be able to click "Browse" and go to C:\cygwin\bin\vim-nox.exe . Then you can click "Always use the selected program to open this kind of file". However, I prefer to just have a "native" Windows Vim install and use that.
You can grep it out of the Windows systeminfo
utility.
systeminfo | grep '^OS'
OS name only:
systeminfo | sed -n 's/^OS Name:[[:blank:]]*//p'
Example:
$ systeminfo.exe | grep '^OS'
OS Name: Microsoft Windows 7 Home Premium
OS Version: 6.1.7601 Service Pack 1 Build 7601
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Workstation
OS Build Type: Multiprocessor Free
$ systeminfo | sed -n 's/^OS Name:[[:blank:]]*//p'
Microsoft Windows 7 Home Premium
You could use uname -s
and compare the output to this:
NT-5.0 = W2000
NT-5.1 = XP
NT-6.0 = Vista
NT-6.1 = W7
I'm running Windows 7 64 bit, so my output is:
CYGWIN_NT-6.1-WOW64
. You can see more information here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With