wrong syntax in bat file

Clone CLONE
June 7, 2010 at 19:44:52
Specs: Windows 7 Ultimate 32 bit, 3 GHz / 1919 MB
I have folder, D:\Images\Paragon\arc_123421254\, that I wish to use a batch file to rename to D\Image\paragon\"date".
I have tried the following .bat file; Doesn't work. What am I doing wrong?

setlocal
cd /d D:\Images\Paragon\
if exist D:\images\paragon\arc*\ ren D:\images\paragon\arc* D:\images\paragon\"%date:/=.%"\
pause
exit

William Lockie


See More: wrong syntax in bat file

Report •


#1
June 8, 2010 at 07:22:17
REN renames files, to rename folders you have to issue the MOVE command and the path applies to the source only.

cd /D D:\Images\Paragon\
if exist arc_123421254 move arc_123421254 "%date:/=.%"
pause
exit

To know more REN /? and MOVE /?

Report •

#2
June 8, 2010 at 10:35:16
Thanks Ivo,
Works great.

William Lockie


Report •

Related Solutions


Ask Question