Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Calling a PC Application from RPG, Part II

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calling a PC Application from RPG, Part II

    ** This thread discusses the article: Calling a PC Application from RPG, Part II **
    ** This thread discusses the Content article: Calling a PC Application from RPG, Part II **
    0

  • #2
    Re:Calling a PC Application from RPG, Part II

    ** This thread discusses the article: Calling a PC Application from RPG, Part II **
    Tom, I did a little investigating and ibm.com said Remote Service may not be started. So I followed instructions to start the iSeries Access for Windows Remote Command service on Windows 2000 and I no longer recieve the error message and the program completes normally but does not seem to trigger any events such as starting Internet Explorer. Any ideas? Thanks

    Comment


    • #3
      Re:Calling a PC Application from RPG, Part II

      ** This thread discusses the article: Calling a PC Application from RPG, Part II **
      Hi Mike, You are jumping ahead of me on this one. Part III, which is coming soon explains all of the details on that. But, here is a possible fix to your solution. Check the properties on the iSeries Access for Windows Remote Command. On, the "Log On" tab, you will want to select the check box that says "Allow service to interact with desktop". I specifically mention this in the next tip. This situation will execute everything with no indicated errors. But, it does not do anything. Well, there is a little sneak peek. I am sure you will have it all figured out by the time it hits the streets. Enjoy, Tom

      Comment


      • #4
        Re:Calling a PC Application from RPG, Part II

        ** This thread discusses the article: Calling a PC Application from RPG, Part II **
        Tom, I tried your suggestion and it still was not working. I just happened to run accross a spool file that was being generated by the RUNRMTCMD and it showed a few errors on different attempts. Anyhow, to make a long story short, the RMTUSER value should be your workstation/windows User and not your iSeries UserId unless they are the same. The RMTPWD value should be your workstation/windows Password and not your iSeries Password unless they are the same and it is case specific. It works wonderfully now and I appreciate the great tip and examples as it will allow us do to some things with longer URLs and File Names. Maybe this is getting to far down the road but do you know of a way to automate the process of starting the service/daemon on the others users systems? Thanks

        Comment


        • #5
          Re:Calling a PC Application from RPG, Part II

          ** This thread discusses the article: Calling a PC Application from RPG, Part II **
          Hi Mike, You could run the STRPCO and STRPCCMD commands to reach out to the client and set it up for you. I am very glad to hear you have it working. You'll be laughing when you see the next article! Have a great day, Tom

          Comment


          • #6
            Re:Calling a PC Application from RPG, Part II

            ** This thread discusses the article: Calling a PC Application from RPG, Part II **
            I am currently in a shop where LANSA is being used for interactive programming. This may or may not cause the IP address retrieval to fail. I do not know if the IP address of the local PC will be retrieved, or the IP address of the AS/400. Running STRPCCMD is out of the question in this case. So far I have not been able to test IP address retreival through LANSA, and wondered if you had a quick answer? Dave

            Comment


            • #7
              Re:Calling a PC Application from RPG, Part II

              ** This thread discusses the article: Calling a PC Application from RPG, Part II **
              Hi Dave, I have not yet had the pleasure of working with LANSA. But, I did take a quick look and I think you can use CL with LANSA. If I were to give you some CL code to retrieve the IP, would that help? Let me know, Tom

              Comment


              • #8
                Re:Calling a PC Application from RPG, Part II

                ** This thread discusses the article: Calling a PC Application from RPG, Part II **
                Using CL is not the issue. The question is whose IP address do I pick up? That of the user, or that of the AS/400? LANSA does not establish a normal interactive session.

                Comment


                • #9
                  Re:Calling a PC Application from RPG, Part II

                  ** This thread discusses the article: Calling a PC Application from RPG, Part II **
                  The QDCRDEVD API has a parameter to specify the Device Name. If you specify the Device Name of the currently running job, then you will receive the IP address of the User.

                  Comment


                  • #10
                    Re:Calling a PC Application from RPG, Part II

                    ** This thread discusses the article: Calling a PC Application from RPG, Part II **
                    Tom, Could you tell me how to call a file that contains embedded blanks in the name, using one of these methods?

                    Comment


                    • #11
                      Re:Calling a PC Application from RPG, Part II

                      ** This thread discusses the article: Calling a PC Application from RPG, Part II **
                      To call a command with blanks, you would just put double quotes around it. Here you can see how to call firefox directly from C:Program FilesMozilla Firefoxfirefox.exe
                      Code:
                       // Build the PC Command to be executed. pcCommand = '"C:Program FilesMozilla Firefoxfirefox.exe"'; commandString = 'STRPCCMD PCCMD(''' + %trim(pcCommand) + ''') PAUSE(*NO)'; monitor; ExecuteCommand(%trim(commandString):%len(%trim(commandString))); on-error; displayString = 'ERROR occurred on STRPCCMD using QCMDEXC!'; DSPLY displayString; endmon;

                      Comment


                      • #12
                        Re:Calling a PC Application from RPG, Part II

                        ** This thread discusses the article: Calling a PC Application from RPG, Part II **
                        Hi Tom, Thanks for the quick response. I am running these commands from the command line for testing in case that causes any issues. I was able to run the command to start firefox as you showed. Tested command: strpccmd pccmd('"C:Program FilesMozilla Firefoxfirefox.exe"') I then ran the following command and I get a Network Error window that states "Windows cannot access \10.10.10.11arcopy" strpccmd pccmd('"start \10.10.10.11arCopy of 02.00.09_Aging Control Totals.pdf"') So I modified the command by moving the double quote as shown here: strpccmd pccmd('start "\10.10.10.11arCopy of 02.00.09_Aging Control Totals.pdf"') and I do not get any errors but the file does not load, I have verified that the path and file name are correct. to test the path I successfully ran this command: strpccmd pccmd('start \10.10.10.11arRVPSTMTP2009013017541394.PDF') Thanks Troy

                        Comment


                        • #13
                          Re:Calling a PC Application from RPG, Part II

                          ** This thread discusses the article: Calling a PC Application from RPG, Part II **
                          Hi Troy, When you are using double quotes with the start command, it will translate this as "Open this folder". Which is not useful in this case, but could have future potential. Hard-Coded Solution: The Hard-Coded solution would be to avoid using the start command and call the program directly. In this situation you would put double quotes around the command and the file name parameter:
                          Code:
                           pcCommand = '"D:\Program Files\Adobe\Acrobat 8.0\' + 'Acrobat\Acrobat.exe"' + ' "\\10.10.10.11\ar\Copy of 02.00.09_Aging Control Totals.pdf"';
                          This could be a problem with Adobe acrobat because the directory and executable name changes through different versions of the application and you may even have it installed on a different drive. Flexible Solution: To provide a flexible solution for Windows users you could use rundll32 to open the file.
                          Code:
                           // Use rundll32 pcCommand = 'rundll32 url.dll, FileProtocolHandler' + ' \\10.10.10.11\ar\Copy of 02.00.09_Aging Control Totals.pdf'; // STRPCCMD to open a PDF commandString = 'STRPCCMD PCCMD(''' + %trim(pcCommand) + ''') PAUSE(*NO)'; monitor; ExecuteCommand(%trim(commandString):%len(%trim(commandString))); on-error; displayString = 'ERROR occurred on STRPCCMD using QCMDEXC!'; DSPLY displayString; endmon;
                          The file name is the last parameter of rundll32, so you do not need to use double quotes. Using the url.dll will force the FileProtocolHandler to figure out which application to open. Enjoy, Tom

                          Comment


                          • #14
                            RUNRMTCMD with Citrix Virtual IPs

                            ** This thread discusses the article: Calling a PC Application from RPG, Part II **
                            The RUNRMTCMD when used with *IP option requires an IP Address. So we have an iSeries application that retrieves the IP address prior to launching the RUNRMTCMD. All works well except for our Citrix sessions using Virtual IP Addresses. Our IP retrieval program does not return the Virtual IP, but only the Citrix server's IP.

                            Does anyone have any experience or iSeries program with retrieving the Virtual IP of a Citrix session that has started an iSeries QZRCSRVS job?

                            Thanks in advance for any help we can get.
                            Vince.

                            Comment

                            Working...
                            X