This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Open a file with the standard application

With AcuCobol we generate files in different formats (pdf, xls, docx, txt, csv,....) and the user wants to open it.

Is it possible to open a file with the standard application on the client? Like clicking on the file in the windows explorer.

1)  "C$system" requires the name of the application (e.g. C$SYSTEM "@[DISPLAY]:C:\notepad myfile.txt")

2) As well as "C$run" (C$RUN "@[DISPLAY]:C:\notepad myfile.txt).

3) Calling the browser control with a file name doesn't work with all formats

The problem is that we don't know what standard apllications are installed on the client.

Am I to silly to find the right statement?

  • 0

    The name of the application is not required. The same as with clicking on the file in windows explorer, windows will automatically use the "default app'lication associated with the file type when you make a system call.

  • Suggested Answer

    0

    The name of the application is not required. The same as with clicking on the file in windows explorer, windows will automatically use the "default app'lication associated with the file type when you make a system call.

  • Suggested Answer

    0  

    Good morning, Mr

    ACUCOBOL-GT 10.5 will include a new library routine called WIN$SHELLEXECUTE.

    This will emulate the ShellExecuteEx() Win32 API function, which is what is executed when a user double-clicks on an icon in Windows Explorer.

    If you are interested in testing 10.5.0, please contact your Account Manager, or open a Case on the Support Portal - https://portal.microfocus.com/s/?language=en_US

    The Beta Test program is launched at the end of August.

    Claudio Contardi

    Lead Technical Support Specialist
    Rocket Software, Italia
    RocketSoftware.com
    linkedin.com/rocket-software

  • 0 in reply to 

    Hi Peter,

    I tried

                  add csys-desktop, csys-maximized, csys-async
                     giving ws-csys-flags
                  call "c$system" using "c:\temp\test.pdf"
                                      , ws-csys-flags
                      giving status-val
                  end-call

    The return value in status-val is "5", nothing happenes.

    Standard application is "Adobe reader DC", clicking on the file in the windows explorer works.

  • 0

    Hi Martin,

    we use C$SYSTEM with the command "start" to open a file with the standard application and it works for us.