8/31/2023 0 Comments Windows folder size![]() Office: Word, Excel, Outlook… Office Apps like Word, Excel, Visio, Outlook, Project, Powerpoint, 2003, 20.Microsoft 365, Azure & Hosting Help with Office 365 Issues.Windows Server windows 2003, 2008, R2 how tos.Windows 11 10 8 7 & XP Windows 2000, XP, Vista, 7 and more How Tos.If EXIST folderSizes.csv del folderSizes.csvĮcho Folder,Bytes Size,Short Size > folderSizes.csvĮcho(%%~nxa,!size!,!newsize!!unit! > folderSizes.csv offĮcho Getting folder sizes for you.storing to folderSizes.csv It provides the full Byte size as a column so that you can easily sort in excel (or whatever). csv file in the run directory, folderSizes.csv. I took Williamsons code and made it export each line to a. > %temp%\tmp.vbs echo wsh.echo FormatNumber(eval(%~1%val%),1) Just in case you'd rather have it in those formats. Using MC ND's excellent code, I've added conversion to Kb, Mb, Gb, etc. If a file needs to be created, redirect the output of the batch to a file getSizes.cmd "c:\temp" > C:\folderList.txt Then the name (and extension if it has) of the folder and the size of the elements under it is echoed to console. It iterates over the indicated folder (passed as parameter to the batch file, or current directory if there is no paramter).įor each folder inside it ( for /d) a recursive dir command is executed inside the inner for command, and from its output, the summary line at the end (extracted by findstr) is parsed (the tokens in for command) and the total size of all the files under this subfolder is retrieved. For each folder in the list, use dir command to retrieve the size of the files under the folder offįor /f "tokens=3,5" %%b in ('dir /-c /a /w /s "%%~fa\*" 2^>nul ^| findstr /b /c:" "') do if "%%~c"="" set "size=%%~b"
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |