Solved

RUNRMTCMD

Posted on 2009-07-01
7
1,663 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
  • 4
  • 3
7 Comments
 
LVL 34

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 34

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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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 34

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 34

Accepted Solution

by:
Gary Patterson earned 500 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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 don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now