Topic "Rename local directory files"

Author Message
fernanda.linsr
[View user's profile]

Joined: 2017-01-10
Posts: 3
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26331
Location: Prague, Czechia
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.
fernanda.linsr
[View user's profile]

Joined: 2017-01-10
Posts: 3
martin wrote:
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.


Thank you! That was very healpful! Very Happy
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License