-1

How can you determine whether a user is using windows version 7 or 8 or 10?

i have

var userAgent = navigator.userAgent;
var match = userAgent.match(/Trident\/(\d+[.]\d+)/);

That checks to see if the user is on IE 11. How can I figure out what version of windows it is using using javascript?

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
Chris Hansen
  • 7,813
  • 15
  • 81
  • 165
  • 1
    Did you look for answers before you asked? http://stackoverflow.com/questions/9514179/how-to-find-the-operating-system-version-using-javascript – epascarello Oct 24 '16 at 12:20

1 Answers1

2

It is listed in the user agent. For windows 10 it is Windows NT 10.0 for windows 8 it is 6.2, windows 8.1 it is 6.3 and windows 7 it is 6.1. For example here is my user agent for windows 10

Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0

Reuben Swartz
  • 206
  • 1
  • 6
  • Please check http://stackoverflow.com/questions/8774560/jquery-detecting-the-operating-system-and-operating-system-version – Arun Oct 24 '16 at 12:23