views:

61

answers:

2

I'm using a virtualized web server and I don't remember whether it's running Windows Server 2000 or 2003. How can I tell which?

Ask the ISP, course, which I did. The question, then, is somewhat academic. Is there any way to tell this from .NET?

I access the machine through Plesk, which is designed to shield you from this kind of arcana.

Why do I want to know this? Because I'm getting ready to install a product that is supported on 2003 but not 2000. (I know this doesn't mean it won't run.)

+7  A: 

You can retrieve this from System.Environment.OSVersion.

Reed Copsey
Thank you... it just hit me after I posted. I was looking for Environment.WindowsVersion, not expecting them to be platform-agnostic.
harpo
A: 

When retrieving version information from System.Environment.OSVersion remember that checking file versions is surprisingly hard.

Grant Wagner
Good tip. The answer I got was **Microsoft Windows NT 5.2.3790 Service Pack 2**, which, after a little searching, I learned corresponds to Server 2003... or Windows XP 64-bit Edition (IA-64)... or Windows XP Professional x64 Edition. I just took a wild guess.
harpo