1.

Solve : Batch file help.. rename file Windows 2003 Server?

Answer»

Hello Group!

I'm trying to CREATE a batch file that will rename a file extension...

The FILENAME is al012007.dat.tmp5

I would like to rename it to al012007.dat

I've tried:
rename *.tmp5 *.dat, but that makes the file al012007.dat.dat

I've ALSO tried:
rename *.tmp5 *
but nothing happens at all. The above command does work when I try it on Windows XP, but not Window 2003 server.

Thanks for any suggestions...
BryanDo you just want to rename 1 file, or all files that are .dat.tmp5?

For 1 file, just use
Code: [Select]ren al012007.dat.tmp5 al012007.dat... but you probably already knew that.

To rename *.dat.tmp5 you can use
Code: [Select]@echo off
for %%a in (*.dat.tmp5) do echo ren "%%a" "%%~NA"



Discussion

No Comment Found