#208372 - 2014-01-23 10:53 PM
Re: Check for 32 or 64 bit
[Re: NTDOC]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4545
Loc: USA
|
So are you saying this...
if exist("C:\Program Files\Microsoft Office\Office15\WinWord.exe")
? "Office 64bit"
else
? "Office 32bit"
endif
...will produce the correct results whether it is Windows 7 32bit or Windows 7 64bit?
|
Top
|
|
|
|
#208377 - 2014-01-24 09:32 AM
Re: Check for 32 or 64 bit
[Re: Arend_]
|
Arend_
MM club member
Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
|
If EXIST(%%ProgramFiles(x86)%%)
;Windows = 64-bit, check for Office
If EXIST("%%ProgramFiles%%\Microsoft Office\Office15\WinWord.exe")
? "Office 64bit")
EndIf
If EXIST("%%ProgramFiles(x86)%%\Microsoft Office\Office15\WinWord.exe")
? "Office 32bit"
EndIf
Else
;Windows = 32-bit, if there is office, office will be 32-bit
EndIf
|
Top
|
|
|
|
#208379 - 2014-01-24 02:18 PM
Re: Check for 32 or 64 bit
[Re: Glenn Barnas]
|
BradV
Seasoned Scripter
Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
|
I think that also has problems because it is only looking for Office15. I think one would have to instead search for winword.exe such as: dir "c:\program files\microsoft office\winword.exe" /s /b If it finds it, then it is 64 bit else repeat with inserting "(x86)" into the string.
|
Top
|
|
|
|
#208381 - 2014-01-24 05:13 PM
Re: Check for 32 or 64 bit
[Re: Glenn Barnas]
|
ShaneEP
MM club member
Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
|
How about this version?
There are still holes (office installed in irregular path, etc..), but should work for the majority.
Function OfficeBits()
$version = Right(ReadValue("HKCR\Word.Application\CurVer", ""), 2)
If Len($version)
If @OnWow64 AND Exist("C:\Program Files\Microsoft Office\Office"+$version+"\winword.exe")
$OfficeBits = 64
Else
$OfficeBits = 32
Endif
Else
$OfficeBits = 0
Endif
EndFunction
|
Top
|
|
|
|
#208382 - 2014-01-24 06:24 PM
Re: Check for 32 or 64 bit
[Re: ShaneEP]
|
BradV
Seasoned Scripter
Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
|
Is WMI always guaranteed to be installed and active? Before writing something to utilize that, we should get that question answered. Given that, I'm more than happy to work on it.
|
Top
|
|
|
|
#208384 - 2014-01-24 07:16 PM
Re: Check for 32 or 64 bit
[Re: ShaneEP]
|
BradV
Seasoned Scripter
Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
|
Maybe you need new hamsters?
|
Top
|
|
|
|
#208396 - 2014-01-25 09:23 PM
Re: Check for 32 or 64 bit
[Re: Lonkero]
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 557 anonymous users online.
|
|
|