Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

cougarmutt

How do I create a unique filename when -put- for each file picked up.

The below script overwrite if it picks up multiple files
I need for it to create a unique filename for each file picked up.
the %RANDOM% does not work


option echo off
option batch on
option confirm off
open sftp://<USERNAME>:<PASSWORD>@<SFTP SERVER URL>

#GRAB SYSCO FILES AND MOVE TO THE EDI\SYSCO\ FOLDER ON BLACKSMITH
lcd "C:\Users\ccancilla\Documents\WinSCP\Blacksmith\SYSCO"
cd /EDI/SYSCO/
put -nopermissions -nopreservetime "SYSCO*.txt" SYSCO_867_%TIMESTAMP%.txt

#GRAB USFS FILES AND MOVE TO THE EDI\USFS\ FOLDER ON BLACKSMITH
lcd "C:\Users\ccancilla\Documents\WinSCP\Blacksmith\USFS\"
cd /EDI/USFS/
put -delete -append -nopermissions -preservetime "USFS*.txt" USFS_867_%TIMESTAMP%.txt

exit