Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > WinFX General

Vista - How do I distinguish between 32 & 64-bit vista?

 
 
Old 09-22-2006   #1 (permalink)
=?Utf-8?B?Sm9obiBFbGxpb3R0?=


 
 

How do I distinguish between 32 & 64-bit vista?

Vista 32 & 64 both report the same OS version.

Existing code that worked for previous Microsoft OS:
// Get the version information
Version vs = os.Version;
PlatformID p = os.Platform;
case System.PlatformID.Win32NT:
switch(vs.Major)
{
case 5:
if (vs.Minor == 0)
return "Windows 2000 " + os.Version.ToString();
else if (vs.Minor == 1)
return "Windows XP " + os.Version.ToString();
else if (vs.Minor == 2)
return "Windows XP 64 " + os.Version.ToString();
else
return "Unknown Windows NT: " + os.Version.ToString();
case 6:
if (vs.Minor == 0)
return "Windows Vista " + os.Version.ToString();
else
return "Windows Vista 64 " + os.Version.ToString();
// assumption for now
default:
return ("Win32NT family:" + vs.Major.ToString() + "." +
vs.Minor.ToString() + " ->" + os.VersionString);

Vista 32 & 64 both report the same version.




My System SpecsSystem Spec
Old 10-19-2006   #2 (permalink)
Bryan Phillips


 
 

Re: How do I distinguish between 32 & 64-bit vista?

Would this work?

Console.WriteLine("This is a {0}-bit OS.", IntPtr.Size * 8);

Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com




"John Elliott" <JohnElliott@discussions.microsoft.com> wrote in message
news:3A536541-269B-432E-B591-75B2D9DEE891@microsoft.com:

> Vista 32 & 64 both report the same OS version.
>
> Existing code that worked for previous Microsoft OS:
> // Get the version information
> Version vs = os.Version;
> PlatformID p = os.Platform;
> case System.PlatformID.Win32NT:
> switch(vs.Major)
> {
> case 5:
> if (vs.Minor == 0)
> return "Windows 2000 " + os.Version.ToString();
> else if (vs.Minor == 1)
> return "Windows XP " + os.Version.ToString();
> else if (vs.Minor == 2)
> return "Windows XP 64 " + os.Version.ToString();
> else
> return "Unknown Windows NT: " + os.Version.ToString();
> case 6:
> if (vs.Minor == 0)
> return "Windows Vista " + os.Version.ToString();
> else
> return "Windows Vista 64 " + os.Version.ToString();
> // assumption for now
> default:
> return ("Win32NT family:" + vs.Major.ToString() + "." +
> vs.Minor.ToString() + " ->" + os.VersionString);
>
> Vista 32 & 64 both report the same version.


My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Re: How to distinguish one PowerShell from another. PowerShell
How to distinguish one PowerShell from another. PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46