I have a simple script to move perform some maintenance operations on the remote Unix SFTP host, but would like to do all of the operations only if some of the files exist on the windows server. Here is example of the simple code I use, and was wondering if WinSCP supports "if exist " windows command:
option batch abort
option confirm off
open sftp://[email protected] -hostkey="xxxxxx" - privatekey=\\location
delete file.txt
rename file1.txt
put file0.txt file.txt
etc...
exit
Would be nice to do all of the above if I could do something like this:
if exist (\\windows server\filename.txt
.....
)
Have to mention that execution is performed using WinSCP.com.