How to rename and move files to new directory

Posted on

QUESTION :

I would like to rename a file that is uploaded to another server from extension .txt to .txt_mvd and move to a different directory for archiving in a Windows batch mode. Can anyone help with what the script commands should be like?

Thanks,
Allen

ANSWER :

Use COPY Command, to copy the file from source to destination location.

Syntax:

COPY source destination

Example:

copy test.txt "D:destinationtest.txt_mvd"

While doing this process, renaming of a file is done automatically at destination location.

That is the Trick in this command.

Leave a Reply

Your email address will not be published.