Automating file transfer in Windows format

Advertisement

Daleritf
Guest

Automating file transfer in Windows format

I am transferring files on a scheduled bases using these commands:
# the script on errors
option batch continue

# Disable overwrite confirmations that conflict with the previous
option confirm off

# Connectto the FTP Site
open sftp://username:password@hostname

# Change Directory
cd /Production/FolderName/

# Transfer all the .tif files in this directory
put D:\LocalFolderName\*.txt -nopermissions -nopreservetime

# Disconnect from the FTP site.
close
exit

Files are getting transferred without a problem but they are converted to Unix format. Server where I am copying these files does not support Unix format. What should I add to my script to transfer files in Windows format?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,453
Location:
Prague, Czechia

Re: Automating file transfer in Windows format

WinSCP does not convert file format by default. Unless you have changed transfer mode in global configuration (in GUI).
Ideally you should isolate the script from GUI configuration using /ini=nul command-line switch.
https://winscp.net/eng/docs/scripting#configuration

Or force the binary mode using -transfer=binary switch of the put command:
https://winscp.net/eng/docs/scriptcommand_put#transfer

Reply with quote

Advertisement

You can post new topics in this forum