vb.net - OS Version check

  • Thread starter Thread starter Marcolino
  • Start date Start date
M

Marcolino

Hi All,
my need is to check if OS is at 32 or 64 bit.
I'm using System.Environment.OSVersion but there is not this
information inside.
Any Ideas?

Thanks
 
The expression
System.Runtime.InteropServices.Marshal.SizeOf(New Integer)
is 4 for 32-bit os, and 8 for 64-bit os.
 
Marcolino said:
Hi All,
my need is to check if OS is at 32 or 64 bit.
I'm using System.Environment.OSVersion but there is not this
information inside.
Any Ideas?

Check GetSystemInfo/GetNativeSystemInfo in MSDN, and check
wProcessorArchitecture member. I don't have a 64-bit OS so I can't test it.

Also check GetVersionEx, and this article:

How to determine Windows version by using Visual Basic .NET or Visual Basic
2005
http://support.microsoft.com/kb/304289
 
The expression
  System.Runtime.InteropServices.Marshal.SizeOf(New Integer)
is 4 for 32-bit os, and 8 for 64-bit os.

Integer is 4 bytes even on 64-bit systems.
 
my need is to check if OS is at 32 or 64 bit.
Any Ideas?

You can check size of pointer:

if (IntPtr.Size == 4) { } //32-bit
if (IntPtr.Size == 8) { } //64-bit
 
It's likely that the 'Integer' should read 'IntPtr'.

Hi All,
my app is running in 32bit mode also on 64bit OS. The problem is that
IntPtr size is 4 even on 64 bit OS this because my app is running in
32bit mode.
Is there another way?

Thanks
 
Hi All,
my app is running in 32bit mode also on 64bit OS. The problem is that
IntPtr size is 4 even on 64 bit OS this because my app is running in
32bit mode.
Is there another way?

Why do you care if you are on 64-bit system if your application is
running as 32-bit one (on WOW)?
You cannot use any 64-bit libraries anyhow until you compile it as 64-
bit (or as any).
 
Marcolino said:
my app is running in 32bit mode also on 64bit OS. The problem is that
IntPtr size is 4 even on 64 bit OS this because my app is running in
32bit mode.
Is there another way?

Yes there is. See the API calls that I posted earlier:
GetSystemInfo/GetNativeSystemInfo, but as others said, it shouldn't matter
unless you are doing something unusual.
 
It is created by ENGLISH version of Windows. Other
languages may not create directory with same name.

There is no ENGLISH version of Windows. The nearest you can get is an
AMERICAN version. Micro$oft have in the past used the cost of creating
different versions as an excuse for their almost doubling of the price of
their goods here in ENGLAND, and for their under the counter dodgy and
legally questionable dealings with certain high profile Internet software
vendors, but it is simply a Micro$oft scam! Even if there was such a version
it would cost them less than a dollar per copy for any modifications they
might make, and in fact they haven't made any modifications at all because
there is no ENGLISH version! They're just a bunch of dodgy fairground
gypsies!

Mike
 
There is no ENGLISH version of Windows. The nearest you can get is an
AMERICAN version. Micro$oft have in the past used the cost of creating
different versions as an excuse for their almost doubling of the price of
their goods here in ENGLAND, and for their under the counter dodgy and
legally questionable dealings with certain high profile Internet software
vendors, but it is simply a Micro$oft scam! Even if there was such a version
it would cost them less than a dollar per copy for any modifications they
might make, and in fact they haven't made any modifications at all because
there is no ENGLISH version! They're just a bunch of dodgy fairground
gypsies!

For all intended purpose "American" version (as you call it or
"English (US)" as
Microsoft calls it) is written in English language and uses quite a
lot of English
words. I am sorry that there is no longer English Empire and one kind
of English
language, but you should learn to live with it.

As for cost, at least in Croatia, localized and non-localized version
have same
price.
 
For all intended purpose "American" version (as you call
it or "English (US)" as Microsoft calls it) is written in English
language and uses quite a lot of English words.

Quite a lot? I don't want "quite a lot". If I'm being charged almost twice
the price then I expect it to be totally in English, not for it merely to
contain "quite a lot" of English words!
I am sorry that there is no longer English Empire and one
kind of English language, but you should learn to live with it.

English Empire? Do you mean the British Empire? If you do and if, as you
say, you are sorry that it no longer exists then you'll have to cry on
someone else's shoulder because I'm quite pleased that it no longer exists,
and I'll be quite pleased when the American Empire ceases to exist as well.
As for cost, at least in Croatia, localized and
non-localized version have same price.

So that's where all the money's going! They're spending cash producing a
localized version for Croatia and they're charging it to us English people!
What a rip off! Or are you perhaps being ripped off for both versions in
Croatia? Mind you, I suppose they've got to rip someone off or they wouldn't
be able to afford to participate in their gangster tactics in places like
Nigeria, where it appears the money flows the other way when a copy of
Micro$oft Windows changes hands . . .

http://www.computerworlduk.com/mana...public-sector/news/index.cfm?newsid=6124&pn=1

Mike
 
So that's where all the money's going! They're spending cash producing a
localized version for Croatia and they're charging it to us English people!

I am truly sorry that I even entered this discussion since it clearly
departed
from original subject.

As for price, it is more similar to UK than to US. However, if I
though that it
was so excessive, I would switch to linux or freebsd.

This is last that I want to say about this.
 
As for price, it is more similar to UK than to US.

Right. So you are being ripped off in Croatia as well! I thought as much.
What a bunch of unscrupulous fairground gypsies Micro$oft are! I'm glad you
agree with me.
However, if I though that it was so excessive,
I would switch to linux or freebsd.

God advice. Thank you. I hope as many people as possible take your advice
and ditch Micro$oft and switch to Linux. In fact that's exactly what I
intend to do when I get fed up of playing with this copy of Vista Ultimate,
which incidentally didn't cost me a penny.

What a dreadful OS it is. Slow and cumbersome and extremely clunky and
always doing things behind my back without my permission! That Office 2007
rubbish is even worse. I think Micro$oft have completely lost the plot! Mind
you, they're so busy moving towards their dream of a future of rented
operating systems and rented software that they're taking their eye off the
ball in the current game.

Thanks for your advice, Josip, about ditching Micro$oft and moving to Linux.
I'll definitely take you up on it, and I hope many others do as well. Thanks
once again.

Mike
 
Right. So you are being ripped off in Croatia as well! I thought as much.

I do not feel ripped of since I earn way more money programming on
Windows
than I lose on licence.
Thanks for your advice, Josip, about ditching Micro$oft and moving to Linux.
I'll definitely take you up on it, and I hope many others do as well. Thanks

This is not my advice if you read carefully. I do not have any
problems with working in Windows (yes, that includes Vista also).
 
I do not feel ripped of since I earn way more money
programming on Windows than I lose on licence.

You may not FEEL ripped off, but you HAVE BEEN ripped off! I know it's not a
lot of money on an individual basis, but multiply that by the millions of
Europeans who paid twice as much as they would in America for off the shelf
copies of XP, and the dozen or so who did the same for off the shelf copies
of Vista, and Micro$oft are onto a nice little earner. And if we were all
happy to be ripped off, as you are, then Micro$oft would have made even
more! A bunch of unscrupulous fairground gypsies with no morals at all,
that's what they are. Personally I think they've become far too big for
their boots with their unscrupulous and often legally questionable trading
methods and the American government needs to rein them in. Perhaps the USA
could use some of the money they have saved on the cheap oil that Europeans
have been and still are dying for on their behalf in Iraq to subsidise
Micro$oft's rip off prices over here until they find time to sort them out
properly ;-)

Mike
 
Back
Top