batch to capture the filename and filesize of all files

January 5, 2012 at 15:25:50
Specs: Windows XP
Hi experts,

I have a few xml files in a folder.I need to capture all the file name and size of all the files into a text file in this format using a batch program:

File1,size1
File2,size2

Ive written the following batch code but its not working.

FOR /F "tokens=*" %%G IN ('dir/b ^"\\masdcbipd100\revclz\ePremis\OH\Archive\*.xml^"') DO echo %%G,%~zG>> \\masdcbipd100\revclz\ePremis\OH\file_list.txt

When I run the above code using just the %%G it works but when I add the %~zG its not running


See More: batch to capture the filename and filesize of all files

Report •


#1
January 5, 2012 at 16:46:41
Double up on the % i.e. %%~zG


Please come back & tell us if your problem is resolved.


Report •
Related Solutions


Ask Question