Changing file extension after upload with put

Advertisement

CAG07
Joined:
Posts:
2

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"

Reply with quote

Advertisement

CAG07
Joined:
Posts:
2

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"

Reply with quote

Advertisement

You can post new topics in this forum