115 pts.
 run a ‘.bat file’ with an AS400 function key
I am trying to run a windows '.bat file' using an as400 function key. I have no knowledge of how to make the AS400 asign the fuction key ie F2 to the run the '.bat file'. Anyone have an idea. I have searched IBM's database and also quizzed my service providers and have received blank stares. Help would me much appreciated. Thank you in advance.

Software/Hardware used:
IBM AS400 and Windows xp or 95
ASKED: February 16, 2010  11:44 AM
UPDATED: February 17, 2010  8:08 AM

Answer Wiki:
One way is to use the RUNRMTCMD command. In your application program test for F2 being used. If it is, then run the RUNRMTCMD command. RUNRMTCMD CMD('C:DOCUME~1BRUCEV~1LIST.BAT') RMTLOCNAME('xxx.xxx.xxx.xxx' *IP) RMTUSER('MyUser') RMTPWD('yyyyyyy') for instance will run the bat file LIST on the PC at IP address xxx.xxx.xxx.xxx using a Windows user id of MyUser and a password of yyyyyyy. There are several other ways, but this is probably the easiest.
Last Wiki Answer Submitted:  February 16, 2010  3:03 pm  by  bvining   6,055 pts.
All Answer Wiki Contributors:  bvining   6,055 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Superbru, F2 can be used from your application only, I dont think there is a way to override the F2 key in OS400…… If it is in the application, then RUNRMTCMD, STRPCO & STRPCCMD will also help.

Somebody correct me I am wrong.

 280 pts.

 

Thanks for your answers guys. I managed to sort my problem. The reason I was doing this excercise was to have cash till pop open with the function key. It would seem you cannot override the F2 key so now I just need to write it to my invoice program and it will open after dunning the CL I have found and manhandled, which works.
*************** Beginning of data ********************************
PGM
DCL VAR(&URL) TYPE(*CHAR) LEN(123) +
VALUE(‘”C:till.bat”‘)
DCL VAR(&STRCMD) TYPE(*CHAR) LEN(123)
STRPCO PCTA(*NO)
MONMSG MSGID(IWS4010)
CHGVAR VAR(&STRCMD) VALUE(‘C:TILL.BAT’)
DMPCLPGM
STRPCCMD PCCMD(&STRCMD) PAUSE(*NO)
ENDPGM: ENDPGM
****************** End of data ***********************************
The CL pops the till neatly when called.
Thanks again

 115 pts.