RUNRMTCMD

I'm using RUNRMTCMD to run RTOPCB on a PC that isn't on the same network, to pass an AS/400 file to a PC.  I'm using the following command values: RUNRMTCMD CMD ('c:\edi\company\EDI2PC.BAT') RMTLOCNAME('12.34.56.78' *IP) RMTUSER(USER) RMTPWD(PASSWORD).  After pressing enter it appears that the command works.  I checked the spooled file and there is a print of the commands that are in the batch file from the PC.  I checked the PC and the command did not run.  Does anyone know what I am missing?
LVL 2
CompTech810Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gary PattersonVP Technology / Senior Consultant Commented:
If you see the commands from the BAT file in the job log, then it ran.  What makes you think it didn't?

A few thoughts:

  • Is it an old job log?
  • Are you certain that you have the correct IP address of the target machine?
  • Is there a bug in your EDI2PC.BAT file that is causing you to think that it isn't working?  A common bug is to use a mapped network drive in your BAT file that isn't mapped in the service that handles RUNRMTCMD requests.  You generally need to use UNC names instead of drive paths (\\servername\sharename\myfile.out instead of z:\myfile.out).
Try this:

RUNRMTCMD CMD ('dir c:\ > c:\runrmtcmd.test.txt') RMTLOCNAME('12.34.56.78' *IP) RMTUSER(USER) RMTPWD(PASSWORD)

Or, stick a command at the top of your BAT file that does something similar that you can check.  Make sure you write output to a local drive or a UNC name.

Then check the root folder of the target PC for a file called runrmtcmd.test.txt.  If it is there, then you are successfully running commands.

- Gary Patterson

0
CompTech810Author Commented:
Sorry late getting back to this.  I'm the only IT guy and had a couple fires to put out.

I tried the command that you specified and it worked.  The commands in my batch file are all local to the c:\ drive.  I'm going to try your suggestion and run a part of my batch file at a time to see where it is failing.  

Do you know if there is a log I can check on the remote PC for errors?
0
Gary PattersonVP Technology / Senior Consultant Commented:
A few things you can do:

  1. Post a copy of your BAT file and we may be able to make some suggestions as to likely problems.
  2. In Control Panel - iSeries Access Administration - Diagnostic Tools, you can configure a Detail Trace.  Filter it to the Incoming Remote Command service.  Don't forget to turn it off when you are done.
  3. Use the following command to start your BAT file:  yourfile.bat > c:\diag_file.txt 2>&1  This will redirect standard output and standard error to the file c:\diag_file.txt (nothing magic about that name or location).  You can then view the diag_file.txt file to see any error messages produced.  For more on input and output redirection, see:  

- Gary Patterson
0
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

CompTech810Author Commented:
I figured it out.  The RUNRMTCMD can run PC OS commands.  I had "RTOPCB /S C:\TRANSFER.TTO" in my batch file.  I then replaced it with the command "RXFERPCB c:\TRANSFER.TTO username password"  and it is now working.  Not sure if the PC couldn't run the RTOPCB command, or it needed to use RXFERPCB with user and password.
0
Gary PattersonVP Technology / Senior Consultant Commented:
Great!  Thanks for posting back with your final resolution.

- Gary Patterson
0
CompTech810Author Commented:
How do I select my solution as the accepted solution?  
0
Gary PattersonVP Technology / Senior Consultant Commented:
You probably needed to provide an AS/400 user ID and password, which is why RXFERPCB worked and RTOPCB didn't.

Odds are, all you need to do is use step 3 from my reply above, 24804415, and you will be able to see the error being generated.

- Gary Patterson
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Operating Systems

From novice to tech pro — start learning today.