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: About omitted quotes

Storing exit code to a file is task external to WinSCP. So it is language dependant.
If you do not know how to do that in VB (there has to be a way), you can create a .bat file like below and execute it from VB instead of executing winscp directly.

winscp.com /command ...

echo %errorlevel% > exitcodefile
JonWayn

About omitted quotes

You're absolutely right, prikryl, those would be the closing quotes for the ""put"" switch. That would explain why the Exit switch was seen as a part of the Put switch. Thanks. The last question was language independent though: How do you pipe return codes to a file?
martin

Re: Capturing Return Code

It looks lyou are missing two double-quoted after put filename argument. Should be:
Shell """C:\Program Files (x86)\WinSCP\WinScp.exe"" /command ""option batch abort"" ""open abc.com"" ""put """"c:\A\Nu File.ttt"""""" ""exit"""

I do not know Visual Basic, so I do not know how do you capture exit code. Anyway, I suggest you use winscp.com for that, not winscp.exe.
JonWayn

Capturing Return Code

I just installed WinSCP - awesome program I must add. I use Visual Basic to upload a file on a regular basis.

Shell """C:\Program Files (x86)\WinSCP\WinScp.exe"" /command ""option batch abort"" ""open abc.com"" ""put """"c:\A\Nu File.ttt"""" ""exit"""

When I run the above statement and then open the site in explorer, the file gets uploaded but with the name 'exit'. If I remove the exit switch all together, then the file gets posted correctly. What am I doing wrong here? I dont seem to lose any functionality by omitting the exit switch but I'd just like to know how to include it

Also, how can I capture return codes? Do I have to specify another file that receives the return code? If so, how?[/code]