Rename with Batch File

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to be able with a schedualed batch file to move and rename a file.

The File comes in as FLT001.flt and I would like to move the file to a
different folder and add current date and time to the file name, is this
possiable?

Thanks............. Alastair.
 
Alastair79 said:
I would like to be able with a schedualed batch file to move and rename a file.

The File comes in as FLT001.flt and I would like to move the file to a
different folder and add current date and time to the file name, is this
possiable?

Thanks............. Alastair.

You could try this batch file:
Line1 @echo off
Line2 set D=%date:~4,10%
Line3 set D=%D:/=-%
Line4 set T=%time:~0,5%
Line5 set T=%T::=.%
Line6 set NewName=FLT001 %D% %T%.flt
Line7 echo ren FLT001.flt "%NewName%"
Line8 echo move "%NewName%" "c:\New Folder"

You may need to adjust the numbers in Line2 and in
Line4 to suit your time zone and preferences. When
finished, remove the "echo" commands in Line7 and
in Line8 to activate the batch file.
 
Back
Top