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

Advertisement

Dan Curious
Donor
Joined:
Posts:
31
Location:
NY

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
**********************************

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
36,007
Location:
Prague, Czechia

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

Reply with quote

Dan Curious
Donor

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.

Reply with quote

Advertisement

You can post new topics in this forum