detect outlook 32bit or 64bit

How can i detect within a cobol program on a Windows PC if there is running a 32bit outlook/excel/word or a 64bit version is running?

If it is possible a solution in cobol.

Thanks in advance.

Tags:

  • basicaly look at the word.exe, outlook.exe files
    if they excist in the directory Program Files (x86) then they are 32bit. If they are in directory Program files then they are 64bit

    CBL_CHECK_FILE_EXIST
    Checks whether a file exists and returns details if it does.
    Syntax:
    call "CBL_CHECK_FILE_EXIST" using filename
    file-details
    returning status-code
    Parameters:
    filename                       pic x(n).
    file-details                   A group item predefined as cblt-exit-params,
                                   containing the following subordinate items:
        cblte-fe-filesize          cblt-x8-compx.
        cblte-fe-date            Group item defined as:
            cblte-fe-day           cblt-x1-compx.
            cblte-fe-month         cblt-x1-compx.
            cblte-fe-year          cblt-x2-compx.
        cblte-fe-time            Group item defined as:
            cblte-fe-hours         cblt-x1-compx.
            cblte-fe-minutes       cblt-x1-compx.
            cblte-fe-seconds       cblt-x1-compx.
            cblte-fe-hundredths    cblt-x1-compx.
    status-code                    See Key
    On Entry:
    filename
    The file to look for. The name can contain a path, and is terminated by a space. If no path is given, the current directory is assumed.
    On Exit:
    cblte-fe-filesize
    The size of the file in bytes.
    cblte-fe-date
    The date the file was created.
    cblte-fe-time
    The time the file was created.
    Comments:
    You cannot use wildcard characters in filenames.
    CBL_CHECK_FILE_EXIST is not stripe-aware. If you use this routine on a file for which striping is enabled, the details returned refer to the first stripe only. Therefore, use this routine on an individual stripe only and refer to the stripe by the stripe name. For more information on the use of striped files, please refer to the section File Striping in the chapter File Handler Configuration.
    You can check the success of the call by examining RETURN-CODE. See Interpreting the Return Code as a File Status Code for more details.
  • Oke that can be a solution, but is there not a way to check in the systemregistry?
  • I found, opened and read the registrykey:

               STRING    "Software\Microsoft\Windows\CurrentVersion\"
                         "App Paths\OUTLOOK.EXE"
                                                   INTO  SUBKEY-NAME-SREG
               END-STRING.

    I get a error when i do the same with:

               STRING    "Software\Microsoft\Office\ClickToRun\"
                         "REGISTRY\MACHINE\Software\Microsoft\"
                         "Office\16.0\Outlook"
                                                   INTO  SUBKEY-NAME-SREG
               END-STRING.

     

    The open registry is done with HKEY_LOCAL_MACHINE.

    Windows 10 with Extend 10.0.1 with path 1619.