#208261 - 2014-01-07 01:09 PM
Check for 32 or 64 bit
|
matzas
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
|
|
|
|
#208267 - 2014-01-07 06:15 PM
Re: Check for 32 or 64 bit
[Re: matzas]
|
Glenn Barnas
KiX Supporter
Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
|
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:;;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: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!
|
Top
|
|
|
|
#208275 - 2014-01-08 08:32 AM
Re: Check for 32 or 64 bit
[Re: ShaneEP]
|
matzas
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. 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
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.
$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
Fresh Scripter
Registered: 2006-10-15
Posts: 12
|
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. $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
|
|
|
|
#208281 - 2014-01-09 05:36 PM
Re: Check for 32 or 64 bit
[Re: Mart]
|
Allen
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
KiX Supporter
Registered: 2003-04-19
Posts: 4545
Loc: USA
|
|
Top
|
|
|
|
#208293 - 2014-01-12 03:28 PM
Re: Check for 32 or 64 bit
[Re: Allen]
|
matzas
Fresh Scripter
Registered: 2006-10-15
Posts: 12
|
thanks...
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 557 anonymous users online.
|
|
|