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

Dan Curious

Re: Is there a way to open a site first on the command line, and then execute scripts?

Ahhh. That's it. That's the problem I've having. It doesn't generate any logs, it just quickly disappears.

Ok, thanks Martin.
martin

Re: Is there a way to open a site first on the command line, and then execute scripts?

In general, this works. Though there are no commands like TRACE, LOG or ONERROR in WinSCP scripting.

Also for scripting, you should use winscp.com, not winscp.exe.
See https://winscp.net/eng/docs/executables
Dan Curious

Is there a way to open a site first on the command line, and then execute scripts?

, using the connection credentials and parameters defined in the site definition, then running scripts against that site.

In other words, something like

winscp.exe "JohnDoe" /console /loglevel=2 /log=debuglog.log /script=JohnDoe.scr


JohnDoe.scr
**********************************
TRACE JohnDoe_trace.txt
LOG JohnDoe_log.txt
#CONNECT JohnDoe - commented out

ONERROR GOTO DISCONNECT

PUT "c:\JohnDoeFiles\JohnDoe.dat"

ONERROR GOTO DISCONNECT
@LABEL DISCONNECT
CLOSE
**********************************