Page 1 of 4 1234>
Topic Options
#208261 - 2014-01-07 01:09 PM Check for 32 or 64 bit
matzas Offline
Fresh Scripter

Registered: 2006-10-15
Posts: 12
Is there any way to get the Microsoft OS version as well?? (64Bit or 32Bit)..
thanks in advanced.


Edited by Mart (2014-01-09 05:07 PM)
Edit Reason: Updated title and moved to a separate thread

Top
#208263 - 2014-01-07 01:41 PM Re: Check for 32 or 64 bit [Re: matzas]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
 Originally Posted By: matzas
Is there any way to get the Microsoft OS version as well?? (64Bit or 32Bit)..
thanks in advanced.


Yes there is.
Have a look at the OSArchitecture()UDF.


Edited by Mart (2014-01-09 05:00 PM)
Edit Reason: Updated title
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#208266 - 2014-01-07 05:09 PM Re: Check for 32 or 64 bit [Re: Glenn Barnas]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
 Quote:
Is there any way to get the Microsoft OS version as well?? (64Bit or 32Bit)..
thanks in advanced.

Also see the @OnWoW64 macro.

From the manual..."@ONWOW64 If this macro returns 1, KiXtart is running in the WOW64 environment on a Windows x64 system."


Edited by Mart (2014-01-09 05:01 PM)
Edit Reason: Updated title

Top
#208267 - 2014-01-07 06:15 PM Re: Check for 32 or 64 bit [Re: matzas]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
 Originally Posted By: matzas
Is there any way to get the Microsoft OS version as well?? (64Bit or 32Bit)..
thanks in advanced.
FYI - a lot of the O/S and Platform data needed for this type of inventory application can be returned with a single function call by using my WMISysInfo() UDF, including O/S and Platform architectures. This can greatly simplify such apps, and will improve performance (compared to individual WMIQuery() calls) by instantiating only a single WMI object. It returns the following array:
 Code:
;;RETURNS        40 element array
;;               0   short/full operating system description
;;               1   kernel description (Win2K, WinXP, Win2K3, Vista)
;;               2   operating system role (workstation, member server, domain controller)
;;               3   operating system service pack level
;;               4   operating system build level
;;               5   uni/multi-processor type
;;               6   Computer Name
;;               7   registered owner,organization
;;               8   Serial Number
;;               9   Install Date - YYYY/MM/DD hh:mm:ss
;;               10  Local Date/Time  - YYYY/MM/DD hh:mm:ss
;;               11  Last Boot Time - YYYY/MM/DD hh:mm:ss
;;               12  TimeZone info (Std, Daylight, Bias)
;;               13  Primary Domain Affiliation
;;               14  Installed Hotfix list
;;               15  OS Version (numeric)
;;               16  Future Use
;;               17  O/S Architecture
;;               18  Install Method (Clean, Upgrade, SysPrep)
;;               19  RAM/PageFile Info (location MinSize MaxSize)
;;               20  System Brand
;;               21  System Model
;;               22  System S/N
;;               23  System BIOS Revision
;;               24  Processor Type
;;               25  Processor Speed
;;               26  Processor Count (Physical)
;;               27  Processor Count (Logical)
;;               28  Processor Cores
;;               29  Physical Memory
;;               30  Fixed-Disk Labels, null if none
;;               31  Fixed-Disk Mount Point ("d:\" for drives, path for mounted volumes) (2K3 & higher)
;;               32  Fixed-Disk Drives (A:-Z:, or "MV:" for mounted Volumes)
;;               33  Fixed-Disk Capacities, bytes
;;               34  Fixed-Disk FreeSpace, bytes
;;               35  CD-ROM Disk List
;;               36  Connected Network Drives
;;               37  Hardware Architecture
;;               38  Processor DataWidth
;;               39  Future Use
, which looks like this when enumerated:
 Code:
00  Microsoft Windows 8 Pro
01  Unknown
02  Member Workstation
03
04  9200
05  Multiprocessor Free
06  ICWD011
07  user/
08  00178-10077-75869-AA763
09  2013/01/05 23:33:30
10  2014/01/07 11:36:02
11  2013/12/21 14:46:27
12  Eastern Standard Time / Eastern Daylight Time / 5
13  itcg.lan,ITCG
14
15  6.2.9200
16
17  64-bit
18  Clean
19  12224
20  Hewlett-Packard
21  HP Compaq 8100 Elite CMT PC
22  2UA04305JS
23  HPQOEM - 20091216
24  Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz
25  2933
26  1
27  8
28  4
29  12817047552
30  ,Work,System Reserved
31  C:\,E:\,\\?\Volume{67bb6fab-57b9-11e2-be65-806e6f6e6963}\
32  C:,E:,MV:
33  749786361856,750153334784,366997504
34  362244497408,308648706048,113971200
35  B:,D:
36  <SNIP>W:=\\icwwcmsp01\WebSites,X:=\\icwismsp01\MediaRoot,Y:=\\icwifpsp01\SWDist
37  x64
38  64
39
The UDF can be downloaded from our web site's Kix UDF Library page. Note that the included _osid() function that generates standard "WINxxx" format names needs to be updated for Win-7/8 and Server 2012. This is returned in element 1, and was used by one of our internal apps so may not be an issue for others.. The UDF was updated today and will be available on our web site after 8pm EST tonight.

Also, if there are any suggestions for the "Future Use" fields, I'll see what I can do to update the UDF to include them.

Glenn


Edited by Mart (2014-01-09 05:01 PM)
Edit Reason: Updated title
_________________________
Actually I am a Rocket Scientist! \:D

Top
#208275 - 2014-01-08 08:32 AM Re: Check for 32 or 64 bit [Re: ShaneEP]
matzas Offline
Fresh Scripter

Registered: 2006-10-15
Posts: 12
 Originally Posted By: ShaneEP
 Quote:
Is there any way to get the Microsoft OS version as well?? (64Bit or 32Bit)..
thanks in advanced.

Also see the @OnWoW64 macro.

From the manual..."@ONWOW64 If this macro returns 1, KiXtart is running in the WOW64 environment on a Windows x64 system."


my mistake --> I wanted to know the microsoft office version 64bit or 32 bit.
is there anyway to figure that??

thanks,


Edited by Mart (2014-01-09 05:02 PM)
Edit Reason: Updated title

Top
#208277 - 2014-01-08 06:45 PM Re: Check for 32 or 64 bit [Re: matzas]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
The only consistent method I could find online to determine the bitness of Office, is to use WMI. It is pretty slow, but seems to work.

 Code:
$objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
$colSoft = $objWMIService.ExecQuery("SELECT * FROM Win32_Product WHERE Name Like 'Microsoft Office%'")

If $colSoft.Count = 0
   $bits = "na"		; Office not installed
Else
   For Each $objItem In $colSoft
      $item = $objitem.caption
      If InStr($item, "-bit") AND Len($bits) = 0
         $bits = Right(Split($item, "-bit")[0], 2)
      Endif
   Next
EndIf

? "Bits: "+$bits

get $


Edited by Mart (2014-01-09 05:02 PM)
Edit Reason: Updated title

Top
#208278 - 2014-01-09 07:38 AM Re: Check for 32 or 64 bit [Re: ShaneEP]
matzas Offline
Fresh Scripter

Registered: 2006-10-15
Posts: 12
 Originally Posted By: ShaneEP
The only consistent method I could find online to determine the bitness of Office, is to use WMI. It is pretty slow, but seems to work.

 Code:
$objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
$colSoft = $objWMIService.ExecQuery("SELECT * FROM Win32_Product WHERE Name Like 'Microsoft Office%'")

If $colSoft.Count = 0
   $bits = "na"		; Office not installed
Else
   For Each $objItem In $colSoft
      $item = $objitem.caption
      If InStr($item, "-bit") AND Len($bits) = 0
         $bits = Right(Split($item, "-bit")[0], 2)
      Endif
   Next
EndIf

? "Bits: "+$bits

get $



thanks, but it seems it's not given the right bits.
i have office Professional Plus 2010 32bit installed.
my version is: 14.0.7106.5003 (32-bit).
and when i run the script it says "Bits: 64"..

is there another way to get this information?? (the bits..)

thanks in advanced...


Edited by Mart (2014-01-09 05:02 PM)
Edit Reason: Updated title

Top
#208279 - 2014-01-09 04:46 PM Re: Check for 32 or 64 bit [Re: matzas]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Would you mind creating a new post, where we can trouble shoot this more? Don't want to further hijack this thread.

Edited by Mart (2014-01-09 05:03 PM)
Edit Reason: Updated title

Top
#208280 - 2014-01-09 05:03 PM Re: Check for 32 or 64 bit [Re: ShaneEP]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Moved post and replies to a separate thread.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#208281 - 2014-01-09 05:36 PM Re: Check for 32 or 64 bit [Re: Mart]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
If you can install an additional dll on your computers, the following UDF will get the bit version of an exe. See notes in the thread.

PSGetBinaryType -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=204276#Post204276

Thinking out loud...
Do a registry check for the path of your office installation
Since Word is included in all versions of office, use the path with WINWORD.EXE
Use the function above to check for 32 or 64 bit.

Top
#208282 - 2014-01-09 05:54 PM Re: Check for 32 or 64 bit [Re: Allen]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
And if you do a registry search on the GUID of office...
http://themagickube.blogspot.com/2011/08/detect-whether-installed-ms-office-2010.html
http://social.msdn.microsoft.com/Forums/...t?forum=worddev

Top
#208283 - 2014-01-09 06:20 PM Re: Check for 32 or 64 bit [Re: Allen]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Yeah I came across both of those solutions when I googled it as well Allen...But with both methods it seemed there were people that it did not work for. Of course those people may have been mistaken.
Top
#208284 - 2014-01-09 07:45 PM Re: Check for 32 or 64 bit [Re: ShaneEP]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Also, another side note...The WMI reports 32 bit on my win 8.1 laptop. Whereas the outlook bitness registry value says x64. Wonder if WMI is just reporting incorrectly?
Top
#208285 - 2014-01-10 03:57 AM Re: Check for 32 or 64 bit [Re: ShaneEP]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
it's windows 8.x dude. office bitness is the least of your worries ;\)
_________________________
!

download KiXnet

Top
#208286 - 2014-01-10 09:24 AM Re: Check for 32 or 64 bit [Re: Lonkero]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
 Originally Posted By: Lonkero
it's windows 8.x dude. office bitness is the least of your worries ;\)


LOL
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#208287 - 2014-01-10 04:12 PM Re: Check for 32 or 64 bit [Re: Mart]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Hahaha, no doubt about that.
Top
#208293 - 2014-01-12 03:28 PM Re: Check for 32 or 64 bit [Re: Allen]
matzas Offline
Fresh Scripter

Registered: 2006-10-15
Posts: 12


thanks...

 Code:
Break On

If @onwow64 = 1 
   $SearchKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Common\InstalledPackages"
Else
   $SearchKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
EndIf

   $RegArray = SearchReg($SearchKey,"Outlook",7)
   If @Error
      ? 'No matching items found'
   Else
      For Each $value in $RegArray
         ? $value
         $x = Join(Split($value, $SearchKey + "\"), "")
         If SubStr($x, 1, 1) = 9 
            ? "office found"   
            If SubStr($x, 20, 1) =  1
               ? "Office 64Bit found"
               $OfficeBit = 64
            Else
               ? "Office 32Bit found"
               $OfficeBit = 32
            EndIf
         EndIf         
      Next
   EndIf

  ? Get $x
Exit

;; 
;;====================================================================== 
;; 
;;FUNCTION       SearchReg() 
;; 
;;ACTION         Searches a specific registry path for a value 
;; 
;;AUTHOR         Allen Powell 
;;		 Adapted, formatted, & documented by Glenn Barnas 
;; 
;;VERSION        1.0 / 2014/01/11 
;; 
;;SYNTAX         SearchReg(Key, String, Search) 
;; 
;;PARAMETERS     Key    - Required -  
;; 
;;		 String - Required -  
;; 
;;		 Search - Required -  
;; 
;;   1 For Value
;;   2 for ValueName
;;   3 for Value and ValueName
;;   4 for KeyName
;;   5 for Value and KeyName
;;   6 for ValueName and KeyName
;;   7 for search in all
;;
;;Remarks:
;;  KiXtart reads and writes default ValueNames as an empty string.
;;  SearchReg() replaces the empty ValueName with the text: <Default>
;;  Remember to replace the text '<Default>' with an empty string if you want to check
;;  the found entries further.
;;
;;RETURNS         
;;
;;  Array containing values where SearchFor string was found.
;;  arraymember format is:
;;    KeyName<=>ValueName
;;   (If the Searchstring is found in the KeyName, ValueName is set to <KeyName>
;;
;;  Errors returned:
;;    @Error    1 = No data returned from search 
;;
;; 
;;DEPENDENCIES   none 
;; 
;;TESTED WITH    WXP, W2K3, W2K8, W2K12, Win7, Win8 
;; 
;;KiXtart:
;;  KiX 4.20
;;
;;Example:
;;  Break On
;;  $RegArray = SearchReg("HKEY_LOCAL_MACHINE\Software\Microsoft","dir",7)
;;  If @Error
;;     ? 'No matching items found'
;;  Else
;;     For Each $value In $RegArray
;;        ? $value
;;     Next
;;  EndIf
;;  ? Get $x
;;  
;;
;;Source:
Function SearchReg($_Key, $_Str, $_SrcIn)
    
   Dim $_Idx
   Dim $_vName
   Dim $_Value
   Dim $_Num
   Dim $_SubKey
   Dim $_fArr
   Dim $_mbr
    
    
   $SearchReg = ''
   $_Num = 0
   $_Idx = 0
   $_vName = EnumValue($_Key, $_Idx)
    
   Do
      $_mbr = ''
      If $_SrcIn & 1
         $_Value = ReadValue($_Key, $_vName)
         If InStr($_Value, $_Str)
            $_mbr = $_Key + "<=>" + IIf($_vName, $_vName, '<Default>')
         EndIf
      EndIf
       
      If ($_SrcIn & 2) And InStr($_vName, $_Str)
         $_mbr = $_Key + "<=>" + $_vName
      EndIf
       
      If $_mbr
         ReDim Preserve $SearchReg[$_Num]
         $SearchReg[$_Num] = $_mbr
         $_Num = $_Num + 1
      EndIf
       
      $_Idx = $_Idx + 1
      $_vName = EnumValue($_Key, $_Idx)
       
   Until @Error
    
   $_Idx = 0
   $_SubKey = EnumKey($_Key, $_Idx)
    
   While $_SubKey
      If ($_SrcIn & 4) And InStr($_SubKey, $_Str)
         ReDim Preserve $SearchReg[$_Num]
         $SearchReg[$_Num] = $_Key + '\' + $_SubKey + "<=><KeyName>"
         $_Num = $_Num + 1
      EndIf
       
      $_fArr = SearchReg($_Key + "\" + $_SubKey, $_Str, $_SrcIn)
      If @Error = 0
         For Each $_mbr in $_fArr
            ReDim Preserve $SearchReg[$_Num]
            $SearchReg[$_Num] = $_mbr
            $_Num = $_Num + 1
         Next
      EndIf
       
      $_Idx = $_Idx + 1
      $_SubKey = EnumKey($_Key, $_Idx)
       
   Loop
    
   Exit VarType($SearchReg) = 8
    
EndFunction

Top
#208339 - 2014-01-17 09:08 AM Re: Check for 32 or 64 bit [Re: matzas]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
I believe all you need to do is check if the program installation path.

x86 32-bit version
C:\Program Files (x86)\Microsoft Office\Office15


x64 64-bit version
C:\Program Files\Microsoft Office\Office15

Top
#208340 - 2014-01-20 09:56 AM Re: Check for 32 or 64 bit [Re: NTDOC]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
LOL Sometimes the simple things are overlooked.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#208342 - 2014-01-20 07:08 PM Re: Check for 32 or 64 bit [Re: Mart]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
There would have to be, at a minimum, a OS bit check too for Doc's suggestion to work. If you have a Windows 32 bit OS, using the logic above, would produce Office 64bit.
Top
Page 1 of 4 1234>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 466 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.081 seconds in which 0.027 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org