?
Solved

RUNRMTCMD

Posted on 2009-07-01
7
Medium Priority
?
1,685 Views
Last Modified: 2013-12-06
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?
0
Comment
Question by:CompTech810
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 24759261
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
 
LVL 2

Author Comment

by:CompTech810
ID: 24794020
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
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 24804415
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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 2

Author Comment

by:CompTech810
ID: 24804517
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
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 24805140
Great!  Thanks for posting back with your final resolution.

- Gary Patterson
0
 
LVL 2

Author Comment

by:CompTech810
ID: 24826523
How do I select my solution as the accepted solution?  
0
 
LVL 35

Accepted Solution

by:
Gary Patterson earned 2000 total points
ID: 24826618
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

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just about everyone has an old PC laying around.  Ask anyone in the IT industry, whether they are a professional or play in it as a hobby.  From outdated Desktops to cheap "throwaway" laptops, they are all around and not as hard to "fix up" as you m…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question