Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: ExecuteCommand on IBM AS400

Try FtpWorkFromCwd=auto raw session settings.
https://winscp.net/eng/docs/rawsettings#ftpworkfromcwd
If it does not help, please post a session log file both for session with and without the settings.
Btw, as a workaround, it might also help to run the command on a new session.
davidcornelius

ExecuteCommand on IBM AS400

I have a remote command that works from the console but does not work from a script

Remote command
RCMD call qsnddtaq ('BCT213' 'CERES4DTDO' x'00128F' 'GO')

This is using FTP onto and IBM AS400
They at present use DOS ftp scripts and this command is run after a file transfer occurs.

When this runs from using
$rmtcommand = "RCMD call qsnddtaq ('BCT213' 'CERES4DTDO' x'00128F' 'GO')"        
$session.ExecuteCommand($rmtcommand)

I get the following error
Output      :

ErrorOutput :
ExitCode    : 0
Failures    : {WinSCP.SessionRemoteException: Specified directory does not exist or cannot be accessed.
              Working directory not changed.}
IsSuccess   : False

AS I am not needing a directory, I can't see how to fix this.