Rename local directory files

Advertisement

fernanda.linsr
Joined:
Posts:
3

Rename local directory files

Hi!

I'm trying to run the script bellow and I need to rename the file from .temp to .txt after the download.

Can someone assist me?

cd /00_fidelity/00_recebimento/04_enriquecimento_kba/Bradesco
lcd C:\Users\HP\Desktop
mv *.txt *.temp
mget *.temp
rm *.temp
mv C:\Users\HP\Desktop\*.temp C:\Users\HP\Desktop\*.txt <- this doesn't work
exit

Reply with quote E-mail

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Rename local directory files

The mv command works with remote files only:
https://winscp.net/eng/docs/scriptcommand_mv

One solution is to directly download the files to the desired extension:
get *.temp *.txt

Or you can rename them in a wrapper batch file using the ren command, after WinSCP script finishes.

Reply with quote

Advertisement

You can post new topics in this forum