Using ASP to determine the OS

N

Nathan Sokalski

I want to determine the operating system using ASP (or VBScript inside of
ASP). I tried to get it using the Request.
ServerVariables(EnvironmentVariable) method. On the web page about ASP in
which I found this method, it gave a list of possible values for the
EnvironmentVariable parameter. One of these, which is the one that I tried
to use, was HTTP_UA_OS. However, this value did not seem to work, and when I
displayed a list of possible values using a For Each loop, it was not in the
list, and none of the other variables looked like they could determine the
OS either. Is this supposed to be an environment variable, and if not, is
there any other way to determine the OS using ASP? Thank You.
 
R

Ray at

Make a page like this to see what server variables are available:

For Each au83rfajksk4hrt In Request.ServerVaribles
Response.Write au83rfajksk4hrt & " = " &
Request.ServerVariables(au83rfajksk4hrt) & "<hr>"
Next

Also see here. http://www.aspfaq.com/5004

Ray at home
 
T

Tom Brown

Nathan Sokalski said:
I want to determine the operating system using ASP (or VBScript inside of
ASP). I tried to get it using the Request.
ServerVariables(EnvironmentVariable) method. On the web page about ASP in
which I found this method, it gave a list of possible values for the
EnvironmentVariable parameter. One of these, which is the one that I tried
to use, was HTTP_UA_OS. However, this value did not seem to work, and when I
displayed a list of possible values using a For Each loop, it was not in the
list, and none of the other variables looked like they could determine the
OS either. Is this supposed to be an environment variable, and if not, is
there any other way to determine the OS using ASP? Thank You.
--



Response.Write Request.ServerVariables("HTTP_USER_AGENT")

This string usually contains some reference to the OS, but it is up to the
browser to determine what it says, and up to you to determine what it means.
Here are some (Win2000) examples:

IE5.5:
Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Mozilla:
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030728

Opera:
Opera/7.0 (Windows 2000; U) [en]

Netscape4:
Mozilla/4.03 [en] (WinNT; U ;Nav)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top