I’d say it depends on how you’re connecting to the AS/400. If you’re using Clinet Access (or whatever it’s called these days), you should be able to use the STRPCCMD to kick off a program or script on your PC.
If you’re using some other way of connecting (Rumba,Mochasoft, etc), then you’ll have to check if/how they implement this. Maybe they have some sort of api that you can use.
STRPCCMD is often the best choice. Under some circumstances, as long as it’s a telnet connection, you can retrieve the IP address of the client and use RUNRMTCMD.
Both have advantages and disadvantages. Be aware that STRPCCMD has no significant security mechanism. Programs can be caused to execute with no authentication to the PC. OTOH, a kind of disadvantage for RUNRMTCMD is the need for authentication.