Jump to content

Is OS 64 Bit?


Recommended Posts

I did some searching and I couldn't find the function I needed. I wanted to know if my EXE (which was built on 32-bit LabVIEW) is running in a 64 Bit operating system.

The Conditional Disabled structure has Bitness, but that reffers to the bitness of the code (is this being built on LabVIEW 32 or 64 bit), not what operating system am I running in.

There is also a property node that is Application.TargetOS, but this also only returns the OS it was designed to run on.

So I wrote a VI to do this, but I wanted to know if there was a better way, a more native way to tell if the operating system I am running in is 64 bit or 32 bit. Right now it reads the registry, and looks at environment variables which seems cheap to me.

I'd like the solution to be universal among all operating systems, but my VI only works on Windows. It has been tested on Windows 7 32-bit, and 64-bit, and Windows XP 32-bit. I'd like to know if there are any issues with it running in XP 64-bit, and Vista 32 and 64.

Is OS 64 Bit.vi

Link to comment

It seems to me that detecting the "Bitness" of the OS has to be OS dependant.

So you would have to write individual code for each OS (eg. using a CDS).

As long as NI does not provide such a property, your VI looks like a very usefull way to get this information (assuming we are on Windows, which is true in 100% of *my* use cases ).

BTW: You are talking about "Application.TargetOS". I think "OS.DetailedName" is much closer to what you are looking for (but still not close enough, since it does not talk about Bitness).

Link to comment

It seems to me that detecting the "Bitness" of the OS has to be OS dependant.

So you would have to write individual code for each OS (eg. using a CDS).

As long as NI does not provide such a property, your VI looks like a very usefull way to get this information (assuming we are on Windows, which is true in 100% of *my* use cases ).

BTW: You are talking about "Application.TargetOS". I think "OS.DetailedName" is much closer to what you are looking for (but still not close enough, since it does not talk about Bitness).

rolf posted a VI on this thread Determine 32 or 64 bit OS

It's the same method used in other languages and uses win api calls.

Edited by ShaunR
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.