Windows 10 home or pro

Page 4 of 4 FirstFirst ... 234

  1. Posts : 11,355
    Windows 10 Home x64 Version 21H2 Build 19044.1706
       #31

    Farvatten,

    Nice, thanks.

    One comment though - I think it would be better to test for the existence of the environmental variable ProgramFiles(x86) than the folder C:\Program Files (x86)
    - This variable is only created on 64 bit systems.
    - Testing for the folder instead would probably be OK for almost all cases but would be fooled by a stupid installation procedure within a stupid application.

    Denis
      My Computer


  2. Posts : 826
    Windows 10 Pro 64bit 21H2 19044.1706
       #32

    Try3 said:
    Nice, thanks.

    I think it would be better to test for the existence of the environmental variable ProgramFiles(x86) than the folder C:\Program Files (x86)
    I'm always glad to give back. ;o)

    I wasn't really familiar with that part of your bat file, guessing it was for the existence of the folder.

    As it turns out, there's actually a registry value called 'PROCESSOR_ARCHITECTURE' that can be used which is either 'AMD64' or 'x86' which for me simplifies this. The 'AMD64' which I'm fine with, could be converted to 'x64' if necessary.

    Code:
    Option Explicit
    
    Dim  wshShell,  RegValue,_
         OSType,    OSEdition,    OSVersion,_
         OSBuild,   OSRevision 
    
    Set wshShell  = CreateObject( "WScript.Shell" )   
    
    
    RegValue      = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName"
    OSEdition     = wshShell.RegRead( RegValue )
       
    RegValue      = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE"
    OSType        = wshShell.RegRead( RegValue )   
       
    RegValue      = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ReleaseId"
    OSVersion      = wshShell.RegRead( RegValue )
       
    RegValue      = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentBuild"
    OSBuild       = wshShell.RegRead( RegValue )
       
    RegValue      = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\UBR"
    OSRevision    = wshShell.RegRead( RegValue )
    
    ' Example - Windows 10 Pro AMD64 Version 1903 Build 18362.449 
    
    Wscript.Echo OSEdition & " " & OSType & " Version " & OSVersion & " Build " & OSBuild & "." & OSRevision
      My Computers


  3. Posts : 11,355
    Windows 10 Home x64 Version 21H2 Build 19044.1706
       #33

    Favatten,

    You've already gone to a lot of trouble so I thought I ought to search for better info on this myself.

    I have seen references to the system variable called 'PROCESSOR_ARCHITECTURE' before but I had not really thought about the Registry entry for 'PROCESSOR_ARCHITECTURE' I always suspected that these parameters related to the CPU not to the OS. I think I have now found confirmation that the Registry entry relates to the CPU so I going to assume that the system variable also does.

    1 An MS-endorsed test is at KB556009 - How To Check If Computer Is Running A 32 Bit or 64 Bit Operating System The KB does not include Windows 10 in its applicability list but I checked the Registry values for Windows 10 on both an x86 CPU & OS and an x64 CPU & OS. It is correct on both - HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0.

    2 The KB also explains a test for the CPU architecture itself but you have to correct their spelling mistake to find the entry. I have checked HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment on both x64 & x86 computers and it is as the KB describes.

    3 Do note that in my para 2 the Registry key value concerned is named PROCESSOR_ARCHITECTURE and is clearly explained as relating to the CPU not to the OS. That, to my mind, undermines the notion that the variable PROCESSOR_ARCHITECTURE relates to the OS rather than the CPU itself.
    - I do not have any x64 CPUs running x86 Windows so I cannot confirm this but I will start using the MS Registry test [my para 1] for OS Type instead of the system variable. I'll also add in the MS Registry test of the CPU architecture [my para 2] in my standard set of system tests [just for completeness, I do not have any use for this result at the moment].
    - I know that lots of threads state that the variable PROCESSOR_ARCHITECTURE does identify the OS not the CPU but I simply choose to avoid the possible error given what the MS article explains. Maybe it operated differently on earlier OSes and nobody has noticed that it has changed.

    Denis
    Last edited by Try3; 03 Aug 2020 at 10:43.
      My Computer


  4. Posts : 826
    Windows 10 Pro 64bit 21H2 19044.1706
       #34

    Try3 said:
    You've already gone to a lot of trouble so I thought I ought to search for better info on this myself.
    ...
    - I know that lots of threads state that the variable PROCESSOR_ARCHITECTURE does identify the OS not the CPU but I simply choose to avoid the possible error given what the MS article explains. Maybe it operated differently on earlier OSes and nobody has noticed that it has changed.
    Thanks! I'm seeing these different answers too.

    Seeing how all my machines are x64, it's not information that's super critical, but it doesn't take much these days to make me curious.

    Someone suggested this which is also a line item found in 'C:\>Systeminfo'

    Code:
    C:\>wmic computersystem get systemtype
    SystemType
    x64-based PC
      My Computers


  5. Posts : 11,355
    Windows 10 Home x64 Version 21H2 Build 19044.1706
       #35

    I'd bet that the wmic computersystem get systemtype result does relate to the OS but I'm going to use the Registry entries explained in the [authoritative] MS article so I am never in any doubt.

    Because I do not have any x64 CPUs running x86 Windows I cannot confirm any of this from my own experience.

    Denis
      My Computer


  6. Posts : 11,355
    Windows 10 Home x64 Version 21H2 Build 19044.1706
       #36

    @Farvatten

    I'm installing a VirtualMachine on one of my computers & will put Windows 10 x86 in it so I can work through all these uncertainties. [Updated even later - it might take me some time to sort this out as the machine with the spare time is old & the VM installation does not currently look as though it is progressing at all. I might have to find a day free on the more modern one. Next week probably.]

    I will check the Registry entries & variables we have discussed in order to write out a table of results:
    - x86 OS on x86 CPU [i.e. results I already have]
    - x86 OS on x64 CPU - Updated 3rd August 2020 - The Registry entries are the same as those for x86 OS on x86 CPU.
    - x64 OS on x64 CPU [i.e. results I already have]

    If you have any particular test suggestions then I will include them.

    Denis
    Last edited by Try3; 03 Aug 2020 at 16:41.
      My Computer


  7. Posts : 11,355
    Windows 10 Home x64 Version 21H2 Build 19044.1706
       #37

    I installed VMs and ran the tests. See Install Windows 10 Virtual Machine in VirtualBox

    The system variables and Registry entries we have discussed do, as others have said already, report the installed OS rather than the hardware itself.

    One comparison revealed the possibility that the SystemInfo reponse might identify the real Type [32/64] of the Processor rather than the installed OS.
    - It certainly revealed the Type of the underlying VM.
    - I'd have to install a 32 bit OS on my 64 bit computer to find out and I'm loathe to try that even though I'd make a full system image beforehand.

    Denis
      My Computer


  8. Posts : 11,355
    Windows 10 Home x64 Version 21H2 Build 19044.1706
       #38

    I've now posted a method for getting the Edition, Version, Build from a Windows disk [even a non-booting one] or a system image in

    Get Edition, Version, Build of a non-booting computer - TenForums

    Denis
      My Computer


  9. Posts : 11,355
    Windows 10 Home x64 Version 21H2 Build 19044.1706
       #39

    Farvatten,

    I can now confirm what we discussed all that time ago.
    - x86 OS on x64 CPU
    - This reports the same as a x86 OS on x86 CPU.
    In other words, all the Registry entries we discussed do indeed report the OS not the CPU itself.

    Bree sent me his data to confirm this [he has a x86 OS running on a x64 CPU].

    Denis
      My Computer


  10. Posts : 826
    Windows 10 Pro 64bit 21H2 19044.1706
       #40

    Try3 said:
    Farvatten,

    I can now confirm what we discussed all that time ago.
    - x86 OS on x64 CPU
    - This reports the same as a x86 OS on x86 CPU.
    In other words, all the Registry entries we discussed do indeed report the OS not the CPU itself.

    Bree sent me his data to confirm this [he has a x86 OS running on a x64 CPU].

    Denis
    Thanks for the update!
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 21:36.
Find Us




Windows 10 Forums