Solved Update a bunch of Foldernames adding _UPDATE at the end

September 13, 2012 at 09:08:22
Specs: Windows XP
Hello guys,
I have a Bunch of Folders in same location.
What I need is a Batch that will Update all of the Foldernames by adding this text at the end:
"_UPDATE"

for example:

"WD3200" --> "WD3200_UPDATE"
"DW5000" --> "WD5000_UPDATE" and so on.

lets assume that my Folders are located here: C:\HDDs\

Thanks!


See More: Update a bunch of Foldernames adding _UPDATE at the end

Report •


#1
September 13, 2012 at 09:21:06
✔ Best Answer
@echo off
for /f %%i in ('dir /ad /b c:\HDDs') do echo move "%%i" "%%i_UPDATE"

Remove the echo to actually do the rename

Tony


Report •

#2
September 13, 2012 at 09:33:49
Hi Tony,
Thanks!!!
I noticed that this is working fine as long as the Batchfile is in the same directory with the suppoesed renamed folders.

so if the Batch is at C:\Hdds\tonysbatch.bat -> it will work
but if its here C:\tonysbatch.bat -> it will prompt an error

In order to fix this I added "cd C:\HDDs" in the first line at the Batch and it worked :)


Thanks again!!!


Report •

Related Solutions


Ask Question