Scripting - where to start, part II

Advertisement

cag8f
Joined:
Posts:
9

Scripting - where to start, part II

This is a continuation of a previous post of mine. I'm getting started with scripting in WinSCP. I'd like to execute a simple script that prints 'hello world' as an output. I now understand how to open winscp.com and run simple commands. I'd like to run a simple script now:

echo hello world

Winscpt documentation indicates that, to run a script, I need to enter:

winscp.com /script=example.txt

But where do I enter this? If I enter this at the winscp.com prompt, I am met with an error:

unknown command 'winscp.com'.

I encounter the same error if I first open a session, then enter that command.

Thanks in advance.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Scripting - where to start, part II

If you run winscp.com (without arguments), you start interactive scripting mode, where you can type/test commands directly, e.g. you can type your echo hello world.

If you want to test script, you save the echo hello world command to e.g. script.txt and execute it with winscp.com /script=script.txt (e.g. from Windows command line, Windows batch file or Windows shortcut).

Again see https://winscp.net/eng/docs/scripting#using_scripting

Reply with quote

Advertisement

You can post new topics in this forum