ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Executing a PC .BAT file

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

  • Executing a PC .BAT file

    Hi,

    I hve a cCL program that runs an MS .BAT file from the iSeries..


    Code:
    0001.00              PGM                                                        
    0002.00              STRPCO     PCTA(*NO)                                       
    0003.00              MONMSG     MSGID(CPF0000)                                  
    0004.00                                                                         
    0005.00              STRPCCMD   PCCMD("\\bavdocs\ph\CR_Batch\reportbatch.bat")  
    0006.00                                                                         
    0007.00              ENDPGM
    However, this won't work when submitted.

    5761SS1 V6R1M0 080215 CL Program Dump BLBUKTST 22/01/15 11:00:01
    Job name . . . . . . . . : QDFTJOBD User name . . . . . . . . : HUDSON Job number . . . . . . . :
    Program name . . . . . . : RUNRPTS Library . . . . . . . . . : PHLIB Statement . . . . . . . . :
    Messages
    Message Message From To
    Time ID Sev Type Text Program Inst Program
    105950 CPD0031 30 DIAG Command STRPCCMD not al QCARULE 07ED RUNRPTS
    lowed in this setting.
    105950 CPF0001 30 ESC Error found on STRPCCMD QCADRV 05A5 RUNRPTS
    command.
    105950 CPF9999 40 ESC Function check. CPF0001 QMHUNMSG 0000 RUNRPTS
    unmonitored by RUNRPTS
    at statement 500, inst
    ruction X'000C'.
    Is there an iSeries command that can execute that batch file in batch?

    Would be a massive + if i could..


    thanks
    www.midlifegamers.co.uk

  • #2
    Re: Executing a PC .BAT file

    Hi Huddy,

    RUNRMTCMD should do it.

    http://www-01.ibm.com/support/knowle.../runrmtcmd.htm

    Neil
    Bloke

    Comment


    • #3
      Re: Executing a PC .BAT file

      Thanks for the suggestion NeilD.

      I tried that after i read this but i wonder if i have thwe syntax correct.


      using strpccmd i use "\\bavdocs\ph\cr_Barch\reportbatch.bat" as the command and that works.


      if i use RUNRMTCMD

      RUNRMTCMD CMD('\bavdocs\ph\CR_Batch\REPORTBATCH.BAT') +
      RMTLOCNAME('1.999.999.99' *IP)

      this doesn't work. It just times out.


      what protocol does this use and what ports?


      Thanks
      www.midlifegamers.co.uk

      Comment


      • #4
        Re: Executing a PC .BAT file

        That sounds like a security issue with the remote system. Not my area really.
        Is this any use - look at Tip 4:
        http://www.ibmsystemsmag.com/ibmi/ad...or-AJS/?page=2
        Bloke

        Comment


        • #5
          Re: Executing a PC .BAT file

          You want to run your "batch" program on the 400 in/as batch? Not interactive? Just submit it. It will work.. We do this all the time..

          Comment


          • #6
            Re: Executing a PC .BAT file

            submitted still nothing.

            “A remote host did not respond within the timeout period. “


            Here’s the command:

            RUNRMTCMD CMD('\\bavdocs\CrystalBatch\reportbatch.bat') RMTLOCNAME('1.130.99.99' *IP) RMTUSER(nnnnnn) RMTPWD(nnnnnn1)

            There must be something on the server side that's stopping this. Ive had the network guys check the article that NeilD posted, and everything seems to be in place and they's installed the IRC.


            What ports does this use btw?
            www.midlifegamers.co.uk

            Comment


            • #7
              Re: Executing a PC .BAT file

              When using *IP, RUNRMTCMD uses the rexec protocol, which runs on port 512.

              I would check that this is open through your firewall(s). By default, i think Windows Firewall will block it, and probably other firewalls will if there are any.

              rexec should only be used over a trusted/secure network.... it sends the password in plaintext, and allows remote users to run anything they want, therefore it'd be very dangerous to enable this over a public network like the Internet.

              Comment

              Working...
              X