Post a reply

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

martin

Better is to upload the files with the new name directly:
    "put -delete -transfer=automatic *.txt *.ord" `

See https://winscp.net/eng/docs/scriptcommand_put#remarks

By using mv you are risking renaming other files, no only those that you did upload.
CAG07

I found the answer after some trial/error. I added an additional line "mv *.txt /*.ord" ` after the put line and the files were renamed.
"open ftp://aaa:aaa@192.168.1.3/" `
"lcd c:\temp\vendor\orders" `
"cd /" `
"put -delete -transfer=automatic *.txt" `
"mv *.txt /*.ord" `
"exit"
CAG07

Changing file extension after upload with put

I've been tasked with the additional requirement of changing the file extension after upload. What is the easiest way in PS to change the file extension with put or does mv have to be used?
Part of the PS script is below and I would like to change all .txt files to .ord after upload.
    "open ftp://aaa:aaa@192.168.1.3/" `
    "lcd c:\temp\vendor\orders" `
    "cd /" `
    "put -delete -transfer=automatic *.txt" `
    "exit"