Windows Vista Forums
Vista Forums Home Join Vista Forums Tech Publications Windows 7 Forum Vista Tutorials Webcasts Tags

Welcome to Vista Forums we are your forum for Windows Vista help and discussion. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > WinFX General

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

Update your Vista Drivers
 
 
Thread Tools Display Modes
Old 09-22-2006   #1 (permalink)
=?Utf-8?B?Sm9obiBFbGxpb3R0?=
Guest


 

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
Guest


 

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
 
Update your Vista Drivers

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How to distinguish one PowerShell from another. RickB PowerShell 1 07-29-2008 10:07 AM
How to distinguish one PowerShell from another. RickB PowerShell 3 07-25-2008 08:55 AM


Complimentary Industry Resources

Vista Forums has joined forces with TradePub.com to offer you a new, exciting, and entirely free professional resource. Visit http://vistax64.tradepub.com today to browse our selection of complimentary Industry magazines, white papers, webinars, podcasts, and more across 34 industry sectors. No credit cards, coupons, or promo codes required. Try it today!




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 2005-2008

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 47 48 49 50 51