Topic: Rename dir with number of files?
Goal is to rename a list of directories by appending the number of files contained to the name:
REN DirName DirName (xN) ;where N=# of files in the directory
Siren doesn't have a file count variable so I thought of using a textfile to save the file count & came up with this to generate the text file from the cmd prompt:
for /D %i in (*) do @(dir /b /a-d "%i" | find /c /v "" > "%i\numfiles.txt")
So now I have numfiles.txt in each of the directories; I thought I could use %T to rename:
%b (x%T{"%fa\\numfiles.txt",1})
Alas %T appears not to accept variables in the "f" parameter.
Also thought of continuing at the command prompt but am stumped trying to get REN to accept variable input.
Ideas? Suggestions?