Namrata Shilpi
Namrata Shilpi

Reputation: 139

WinSCP How to check for directory existence before creating it on FTP server?

Trying to automate via Jenkins: Transfer files from Local Windows directory to FTP directory via WinSCP console scripting.

Problem statement: Need to check whether a folder exists on FTP server before initiating upload.

This is the code I'm trying to execute via winscp /script=abc.txt

abc.txt as follows:

open ftp://xyz
mkdir /Server_folder/test_folder/ABC
put FROM_LOCAL_PATH TO_SERVER_PATH
bye

Upvotes: 2

Views: 1353

Answers (1)

hakamairi
hakamairi

Reputation: 4678

Since you clarified you are using WinSCP scripting console

option batch continue
mkdir some_dir
option batch abort

Upvotes: 2

Related Questions