I use an ActiveXObject in Javascript.
var shell = new ActiveXObject("WScript.Shell");
exec = shell.exec('cmd /c ftp -i -A -s:file.ftp host);
var output = exec.StdOut.ReadAll();
I'm getting the expected error "Could not create file" because the file already exists on the server. Everything's ok here. But the output doesn't display the error codes of ftp, while the Run method does (553 Could not create file).
I do not use Run method because the only output possible consists in redirecting the output into a file, on the client machine.
Trust me, I read a lot of websites (including Windows official descriptions of Run, Exec)
How can I get the error codes of ftp command using WScript.Shell.Exec command?
More info:
exec.StdOut.ReadAll() output ->
"bin
cd my_dir/
mput file_path file_path
Could not create file.
Could not create file.
quit"
output file from WScript.shell.run ->
ftp> bin
200 Switching to Binary mode.
ftp> cd my_dir/
250 Directory successfully changed.
ftp> mput file_path file_path
200 PORT command successful. Consider using PASV.
553 Could not create file.
200 PORT command successful. Consider using PASV.
553 Could not create file.
ftp> quit
221 Goodbye.