Last active
April 6, 2023 16:30
-
-
Save sharunkumar/8caf903c146cbcc4c341571a6c6562df to your computer and use it in GitHub Desktop.
Windows Batch script for getting the size of the folder in bytes. Usage: folder-size "<directory>"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal ENABLEDELAYEDEXPANSION | |
set firstline=. | |
set secondline=. | |
@FOR /F "tokens=1 delims=^^" %%G IN ('dir /s /a "%~1"') DO ( | |
set firstline=!secondline! | |
set secondline=%%G | |
) | |
echo !firstline! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment