Script Not to Overwrite

Advertisement

fang
Joined:
Posts:
2

Script Not to Overwrite

Hi All,
I and trying to configure a script to move a file from one location to another. If the file already exists in the destination location for the copy not to take place leaving the source file where it is. E.g. Do not move file if file already exists in destination location.

This is my current script:
open ftpes://**/ -certificate="**" 
 
cd /COSURV
lcd Q:\COSURV
 
get -delete Cosurv_Enterprise.txt
 
exit
 
# Execute the script using a command like:
# "C:\Program Files (x86)\WinSCP\WinSCP.exe" /log="C:\writable\path\to\log\WinSCP.log" /ini=nul /script="C:\path\to\script\script.txt"

Reply with quote

Advertisement

fang
Joined:
Posts:
2

Script Not to Overwrite

Thanks Martin,
I tried this however once the file has been copied it leaves the file in its original location. What I am trying to do it:
  • File Amsurv_Enterprise.txt in remote location.
  • Check if file Amsurv_Enterprise.txt already exists on local location.
  • If file already exists in local location then do not move file from remote directory and exit.
  • If the file does not exist in local directory the move file from remote directory to local directory and exit (Move so that once copied from the remote directory to local directory, the file is deleted from the remote directory so it only exists in the local directory.).
Many Thanks for your help.

Andy

Reply with quote

Advertisement

You can post new topics in this forum