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
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