Hello Everyone..
Thanks 'Wonko' for your great help and support....
DIRUSE /M "C:\Users\Kdeva\Music" "C:\Users\Kdeva\Videos" "C:\Users\Kdeva\Desktop" "C:\Users\Kdeva\Documents" "C:\Users\Kdeva\Downloads" > myvol.log pause
I have executed above command and It gives following result in form of 'myvol.log' file-
Size (mb) Files Directory 17.75 21 SUB-TOTAL: C:\USERS\KDEVA\MUSIC 1.01 29 SUB-TOTAL: C:\USERS\KDEVA\VIDEOS 245.22 304 SUB-TOTAL: C:\USERS\KDEVA\DESKTOP 0.09 2 SUB-TOTAL: C:\USERS\KDEVA\DOCUMENTS 14420.99 14103 SUB-TOTAL: C:\USERS\KDEVA\DOWNLOADS 14685.06 14459 TOTAL
Now I want to use a variable 'BACKUP_SIZE' that will hold Total size of all folders. .i.e BACKUP_SIZE=14685 MB
So how I can set Total Size value to 'BACKUP_SIZE' ?
May be I should use something like this ?
for /F "usebackq tokens=?" %%A in (`find " TOTAL " myvol.log`) do set BACKUP_SIZE=%%A set BACKUP_SIZE=%BACKUP_SIZE:~x,-y% set /a BACKUP_SIZE=BACKUP_SIZE+10 echo BACKUP Folder is %BACKUP_SIZE%MB pause
Any better .cmd way to calculate Total sizes of all above folders ?
What value I should use in place of Red Highlighted values ?
I don't understand how you guys read a value within from .txt or .log file ?
Please provide me some good pages so that I can learn how to get a value within from .txt files ?
Thanks & Regards...