Topic "New to Winscp and I am having a problem in executing a batch"

Author Message
[View user's profile]

Joined: 2011-03-18
Posts: 2
I am new to Winscp and I am having a problem in executing a batch file.

The scenario is something like this:

I have a batch file A, two folders (up B and down folders C), some text files in up folder D, a text file E (different from the files in D) and a ppk file F. All these things are in one folder only.

The batch file A is having a script (script is shown below) which contains text. If that text contents are true (means if that text (text contents are related to E i.e. if the text file E is executed) is executed) then only the files in up folder B moves to down folder C.

And the script in batch file A is:

C:\somefolder\WinSCP3.exe /console /script=E.txt /log=session.log
if errorlevel 1 goto error
xcopy C:\somefolder\up\*.* C:\somefolder\down\ /y
del C:\somefolder\up\*.* /Q
echo Upload failed, keeping local files
And the content in text file E is:

option batch abort
option confirm off
change remote directory
cd \somedirectory
option transfer binary
put C:\somefolder\up\*.*
I don't know why the files from up folder is not moving to down folder.

Please let me know where exactly the problem is and how to resolve that problem....
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26858
Location: Prague, Czechia
If you want to check the exit code of WinSCP from batch file, you need to use
Martin Prikryl

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License