![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Re: How to distinguish one PowerShell from another. | PowerShell | |||
| How to distinguish one PowerShell from another. | PowerShell | |||