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?
Forgot to include the path where both scripts and files are all located is - C:\ITServices\opentext-efax-ldife
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 ^
"open XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ -hostkey=""ssh-rsa 1024 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"" -rawsettings FollowDirectorySymlinks=1 SFTPMaxVersion=3" ^
"put -nopermissions -nopreservetime exportuser.ldf" ^
"get -nopermissions -nopreservetime sftpstatuslog.txt" ^
"exit"
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")