Link to home
Start Free TrialLog in
Avatar of LarrySingleton
LarrySingleton

asked on

Working for /f script, but need filesizes

I received help before building a script that works great, but I'd like to amend the script to show file sizes of all of the *.mp3 that it finds.  

Here is the script(from billprew):

@echo off
REM Process each line (server name) from server text file
for /F %%A in (Servers3.txt) do (
  REM Find all MP3 files on this server and report it
  for /F "tokens=*" %%B in ('dir /s /a-d /b \\%%A\Data\*.mp3') do (
    echo %%A,%%B>>C:\Scripts\MP3.csv
  )
)

How would we get it to list file sizes of the MP3's it finds into the csv?

thanks!
Avatar of sjklein42
sjklein42
Flag of United States of America image

This token will show the size

%%~zB

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of sjklein42
sjklein42
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LarrySingleton
LarrySingleton

ASKER

Ok thanks for the response(s).  I am testing now.
Awarding 25 pts to sjklein42 for partial answer and 75 to jason987 for elaboration/completion.

Thanks to both!