Topic "System Error Code 2 - Batch Script Automation Failure"

Author Message


I have created a batch file and the weird thing is it has worked sometimes but more or less does not for an automated upload/pull command of a single file. The destination creates the pull file after I send over the LDIF file. I already set the home directory in WinSCP to be the directory in question and the file is absolutely there. Really need assistance as this seems simple and yet makes no sense why it's failing.

Here is the script -

@echo off

"C:\Program Files (x86)\WinSCP\WinSCP.exe" ^
/log="C:\DoesntMatter\opentext-efax-ldife\FTP Transfer Log.log" /ini=nul ^
/command ^
"put -nopermissions -nopreservetime exportuser.ldf" ^
"get -nopermissions -nopreservetime sftpstatuslog.txt" ^

And here is the failure -

> 2017-07-25 17:35:15.672 Script: put -nopermissions -nopreservetime exportuser.ldf
. 2017-07-25 17:35:15.672 Copying 1 files/directories to remote directory "/"
. 2017-07-25 17:35:15.672 PrTime: No; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask:
. 2017-07-25 17:35:15.672 TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; InclM: ; ResumeL: 0
. 2017-07-25 17:35:15.672 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
* 2017-07-25 17:35:15.673 (EOSError) System Error. Code: 2.

* 2017-07-25 17:35:15.673 The system cannot find the file specified
. 2017-07-25 17:35:15.673 Asking user:
. 2017-07-25 17:35:15.673 File or folder 'exportuser.ldf' does not exist. ("System Error. Code: 2.

. 2017-07-25 17:35:15.673 The system cannot find the file specified")

Forgot to include the path where both scripts and files are all located is - C:\ITServices\opentext-efax-ldife
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
What do you mean by "I already set the home directory in WinSCP"?

If you put lpwd before put, what does it say?

Show us a complete session log file.

Cannot you use absolute paths in the script?

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