WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: joebandit on May 03, 2014, 08:14:12 PM

Title: Identifying whether a system is 32 or 64 bit
Post by: joebandit on May 03, 2014, 08:14:12 PM
Searching revealed no definitive answers so here goes, I have winversion telling me that 8.1 is 2-6.3 ok, but how does one tell whether the system is 32 or 64 bit other than checking to see if there exists a Program Files(x86), which I have already found isn't a viable solution as I have a program that creates a program files(x86) folder on a 32 bit system.
Title: Re: Identifying whether a system is 32 or 64 bit
Post by: George Vagenas on May 03, 2014, 09:49:47 PM
I think this should do it.
Code (winbatch) Select
if Environment('ProgramW6432')!='' then display(5, 'Test for 64-bit','System is 64-bit')
Title: Re: Identifying whether a system is 32 or 64 bit
Post by: JTaylor on May 03, 2014, 10:12:37 PM
Take a look at WinMetrics().

Jim
Title: Re: Identifying whether a system is 32 or 64 bit
Post by: Deana on May 04, 2014, 10:14:16 AM
Local machine bitness can be determined using the WinMetrics Function.

Code (winbatch) Select
If WinMetrics(-7)|WinMetrics(-2)==3 Then Pause('Windows Bitness','64-bit Platform')
Else Pause('Windows Bitness','32-bit Platform')


Reference: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/64-bit+How~To~Check~If~Computer~Is~Running~A~32~Bit~or~64~Bit~Operating~System.txt
Title: Re: Identifying whether a system is 32 or 64 bit
Post by: joebandit on May 08, 2014, 05:34:48 AM
Thanks all, I'll give a look at using one of them.