1.

Solve : loop through directories?

Answer»

Hi,

I have a directory which CONTAINS a lot of subdirectories and each subdirectory contains one file. A these files have the same NAME and I WANT to rename all these file.
How can I dod that with a .bat file?
Thanks.

SandraIt's been a while SINCE my DOS DAYS, but if I recall, this should work in a batch file:

for %%f in (dir /b /s *.*) do ren %%f newname

Change newname to anything you wish. Make sure you run your batch file your top level directory.

Good luck,



Discussion

No Comment Found