Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

ArtR

open command not working in script, but works in console.

I am on a Windows 10 Pro machine.
I was on WinSCP 5.9 when this didn't work. I upgraded to 5.15.9 Build 10071 and it still didn't work.
No Log file is produced.
Here is what I did...

I cd to WinSCP directory and type in the following command:

>WinSCP.com /script=C:\Users\artr\Documents\ReceiveTEST.txt

The script contains the following code:

option echo on
option batch on
option confirm on
open TESTTran/myTest
lcd T:\TESTRECV
put -nopermissions -nopreservetime *.DAT
exit

I get the Host prompt twice and then it exits the script, as follows:

echo on
option batch on
batch on
reconnecttime 120
option confirm on
confirm on
open
Host:
Host:

However when I type in the WinSCP command:
>WinSCP.com

I am able to execute the open command as it is in the script directly:
winscp> open TESTTran/myTest
Searching for host...
Connecting to host...
Authenticating...
Using username "xxxxxx".
Authenticating with public key "xxxxxx".
Authenticated.
Starting the session...
Session started.
Active session: [1] TESTTran/myTest
winscp>

I am then able to execute the other commands in the script.

Why is the script not working?