Командная строка windows размер папок

How to find the size of a file

In Windows, we can use dir command to get the file size.

C:\>dir vlcplayer.exe
Directory of C:\

02/22/2011  10:30 PM        20,364,702 vlcplayer.exe
1 File(s)     20,364,702 bytes
0 Dir(s)  86,917,496,832 bytes free

But there is no option/switch to print only the file size.

Get size for all the files in a directory

Dir command accepts wild cards. We can use ‘*” to get the file sizes for all the files in a directory.

C:\>dir C:\Windows\Fonts
Volume in drive C is Windows 7
Volume Serial Number is 14A1-91B9

Directory of C:\Windows\Fonts

06/11/2009  02:13 AM            10,976 8514fix.fon
06/11/2009  02:13 AM            10,976 8514fixe.fon
06/11/2009  02:13 AM            11,520 8514fixg.fon
06/11/2009  02:13 AM            10,976 8514fixr.fon
06/11/2009  02:13 AM            11,488 8514fixt.fon
06/11/2009  02:13 AM            12,288 8514oem.fon
06/11/2009  02:13 AM            13,248 8514oeme.fon
06/11/2009  02:13 AM            12,800 8514oemg.fon

We can also get size for files of certain type. For example, to get file size for mp3 files, we can run the command ‘dir *.mp3‘.

The above command prints file modified time also. To print only the file name and size we can run the below command from a batch file.

@echo off

for /F "tokens=4,5" %%a in ('dir c:\windows\fonts') do echo %%a %%b

Save the above commands to a text file, say filesize.bat, and run it from command prompt.

Get directory size

There’s no Windows built in command to find directory size.  But there is a tool called diruse.exe which can be used to get folder size. This tool is part of XP support tools.  This command can be used to get directory size. This command’s syntax is given below.

diruse.exe   directory_name

C:\>diruse c:\windows

Size  (b)  Files  Directory
12555896050  64206  SUB-TOTAL:  C:\WINDOWS
12555896050  64206  TOTAL:  C:\WINDOWS

As you can see in the above example, diruse prints the directory size in bytes and it also prints the number of files in the directory(it counts the number of files in the sub folders also)

To get the directory size in mega bytes we can add /M switch.

C:\>diruse /M C:\Windows

Size (mb)  Files  Directory
11974.24  64206  SUB-TOTAL: C:\WINDOWS
11974.24  64206  TOTAL: C:\WINDOWS

Download XP Support Tools

Though the tool is intended for XP and Server 2003, I have observed that it works on Windows 7 also.  The above examples were indeed from a Windows 7 computer.

It’s necessary to check the folder sizes to determine whether they are using up too much storage space. Additionally, you would also want to view the folder sizes if you were transferring a folder over the internet or into another storage device. 

Fortunately, seeing the folder sizes is very easy on Windows devices. There are graphical and command-line based applications available in windows that provide you with multiple ways to do it. 

How to Show Folder Size on Windows

You can easily see the folder size using the file explorer on Windows. File explorer also provides other folder information like date creation, size, folder path, and many more. Furthermore, You can also use CLI applications like Powershell and CMD to get the folder size details. We will go thoroughly on how to do these.

Using File Explorer

File explorer gives easy access to the file and folder details on windows. As stated earlier, you can also view other details related to the folder using it. 

Here’s how to see the folder size using it;

  1. Navigate to the file explorer and go to the directory of the folder.
  2. Hover your mouse cursor over the folder for a few seconds. 
  3. You will see the folder tips inside a yellow box, showing you the folder’s size, date created, and other related info.

Note: You will not be able to use this feature if it is disabled in the folder’s option.

To enable the Folder tips, follow these steps; 

  1. Press Windows Key + R to open Run
  2. Type CMD in the field and hit enter.
  3. Now, execute this command in CMD. This command will open the Folder options.  C:\Windows\System32\rundll32.exe shell32.dll,Options_RunDLL 0\
    Folder-option-using-cmd

  1. Go to the View tab. 
  2. Now, check the Display the size information in folder tips to enable this feature.
  3. Finally, Click on Apply.  
    Folder-options

Note: You can also open the Folder Options by clicking on the three dots on the top panel of the file explorer and then going to Options

Using Folder Properties

You can use folder properties to check different folder Info like its size, date created, attributes, and much more. To see the folder’s size using this, follow these steps;

  1. Choose the folder you want to see the size of and right-click on it. 
  2. Go to Properties.
  3. You will now get to see the details like Size and Size on disk of that specific folder.
    Folder-Properties

Using CMD

There are command lines that you can use to check the folder size on the go. It just requires you to execute the command and shows you every detail you want of the folder. To use this for viewing the folder size, perform these steps;

  1. Open the command prompt with elevated privileges. To do so, Press Windows Key + R and type CMD. Now,  press Ctrl + Shift + Enter.
  2. Now, enter the command cd/d to change the file directory.  In place of E:\folder, use the location of the folder where the file you want to view is placed.
    cd/d E:\folder
    Change-folder-directory-in-CMD-

  3. Now, the file directory will be changed to your desired file’s location.
  4. Now, type dir and hit enter. This will give you a detailed overview of that directory. 
    Dir-command-

  5. Search for your file’s name, and you will see its size on the side of it. 

Using PowerShell

Powershell is another advanced CLI tool you can use to check the folder sizes. There are several command lines you can use for this. However, this article will suggest some useful and efficient ones. Here’s how to use powershell for checking the file sizes.

  1. Press Windows key + R. Type Powershell and hit enter.
  2. Now, use the cd command to change the directory to your desired folder. 
  3. For instance, we want to see the size of a folder named images located in th E:\ drive, so we have to change the directory to that specific folder location. In such a case, execute the command like this
    Cd E:\images
    change-directory

  4. Then copy this command and paste it to the powershell window. You will now immediately get the folder’s size in KB, GB or MB. 
    view-folder-size-in-powershell-

switch((ls -r|measure -sum Length).Sum) {
 {$_ -gt 1GB} {
     '{0:0.0} GiB' -f ($_/1GB)
     break
   }
   {$_ -gt 1MB} {
     '{0:0.0} MiB' -f ($_/1MB)
     break
   }
   {$_ -gt 1KB} {
     '{0:0.0} KiB' -f ($_/1KB)
     break
   }
   default { "$_ bytes" }
 }

There is another command you can use to see the contents inside the folder along with their file sizes. To use it, paste this command into the powershell. Just remember to change the folder directory E:\images to your desired one.
Get-ChildItem -Path E:\images\ -Recurse | Where-Object {$_.PSIsContainer -eq $false}   

powershell-code

 This command doesn’t require changing the root directory, so it’s easy to use too. However, it doesn’t show the total folder size.

Frequently Asked Questions

How to See the Hidden Folders on Windows 11?

To see the hidden folders, go to File explorer. Then, click on the View tab, and from the Show option check the Hidden items. You can also see which folders are kept hidden in the system using CMD. For this, open CMD and execute this command;
dir C: /a:h /b /s

Change the drive letter (it is C: in this command) to any of your desired drives. This will instantly show the hidden folders in that drive. This command will also work for the previous version of Windows.

How to Fix if File Explorer Isn’t Showing Folder Size?

When a folder’s path is more than 260 characters long, File Explorer cannot display its size. The fix for this is to decrease the path length or you can use other processes mentioned in this article to check the folder’s size. 

Download Windows Speedup Tool to fix errors and make PC run faster

Has it ever happened to you that a disk is completely full but you don’t know why? In that case, we can check Disk Space Usage in a Folder to know how big a folder is and how much space is it taking. We have a few methods on how to show Folder Size in Windows 11/10. Let us check them out.

How to show Folder Size in Windows 11/10

folder-options-pop-up-folders

To show the Folder size in Windows 11/10, open File Explorer Options. Click on the View tab and select Show pop-up description for folders & desktop items. Click Apply and Exit. This post shows multiple ways to disable pop-up descriptions for folder & desktop items. You can also use our free Ultimate Windows Tweaker to change these settings. You will see the tweak under Customization > This PC > Display file type information on Folder tips.

How to check Disk Space Usage in a Folder in Windows

The following are methods to Check Disk Space Usage in a Folder in Windows 11/10.

  1. Check the Folder’s Size from File Explorer
  2. Check the Folder’s Size from Command Prompt
  3. Check the Folder’s Size from Windows Settings
  4. Check the Folder’s Size from TreeSize

Let us talk about them in detail.

1] Check the Folder’s Size from File Explorer

Let us start by checking the Folder’s Size from File Explorer. The only caveat with this method is that you won’t be able to see folder storage usage but will be able to see how much space is it taking. To do the same, follow the prescribed steps.

  1. Open File Explorer on your computer.
  2. Navigate to the location of the folder you want to check the size of.
  3. Right-click on the folder and select Properties.
  4. Go to the General tab and check both Size and Size on disk.
  5. Click Ok to exit.

If you think this method is too lengthy, you can just hover your cursor over the folder you want to know the size of. You will see a lot of details about that folder, from there, you can check the Size. Hopefully, this help you in managing your storage.

2] Check the Folder’s Size from Command Prompt

If you are familiar with CMD, you can use it to check the folder size. It is quite easy, all you have to do is run some commands in the elevated mode of Command Prompt. So, open Command Prompt as an administrator and run the following command.

cd/folder-name

Now, that you are in that folder, run the following command and it will print out all the details you need.

dir/s

Every single subdirectory will be scanned and the size of the folder will be displayed. That is how you can use Command Prompt to see your folder’s details.

Read: How to get Folder Size using PowerShell

3] Check the Folder’s Size from Windows Settings

Last but not least, we can also try to check the size of the folder using Windows Settings. Windows Settings is a graphical interface that can help you in configuring your system and knowing its details. To know the size of the folder using Settings, try the following steps.

  1. Open Settings.
  2. Go to System > Storage.
  3. Click on the Show more categories button placed under Temporary files.
  4. You will be able to see all the categories consuming your storage, click on Others.
  5. The disk space consumed by every single folder will be displayed there. Look for the folder you want to check the size of, from the list.

Hopefully, know you know to check the disk space usage in a folder.

Read: How to sort Folders by Size or Month in Windows

4] Check the Folder’s Size from TreeSize

TreeSize Free

You can also use a freeware called TreeSize to know your folder’s size. Using the context menu of a folder or a drive, TreeSize can be used to see the size of folders, subfolders, files and NTFS compression rates. There are other Free Disk Space Analyzer software too that you may want to take a look at.

This will help you free up & increase hard disk space on your PC.

How do you see what folders are taking up space in Windows 11?

You can use Windows Settings to know which folder is taking up space on your Windows 11 computer. It is not straightforward, you need to dig a little deeper to fetch the information. But there is nothing to worry about; in this section, we will show you can do this probing. Just follow the prescribed steps.

  1. Launch Windows Settings by Win + I.
  2. Go to System > Storage.
  3. Click on Show more categories. It will be under Temporary files.
  4. Go to Others.
  5. You will be able to see details of all the folders there.

Similarly, you can check the details on a Windows 10 computer.

Read: Folder is Empty but has Files and Shows Size in Windows

It is quite easy to know what files are taking up space and how much space they are taking using Windows Settings on both Windows 11 and 10. You need to go to Settings > System > Storage. There you can see file types along with the amount of space they are taking. To know more, just click on Show more categories. All file types will be visible. In case your Hard Disk is filling up for no particular reason, check our article to resolve this issue.

Yusuf is an Engineering graduate from Delhi. He has written over 1000 technical articles and has knowledge of programming languages including Java, and C++, and technologies such as Oracle 12C and MsSQL. Troubleshooting Windows is his favorite past-time.

Quick Tips

  • There are plenty of ways to show the folder size on Windows, both simple and advanced.
  • You can hover your mouse on the folder, but the feature might not work on some systems.
  • At times, you might want to use a third-party solution.

Method 1: Hover the Mouse Pointer over the Folder

By far, the easiest way to show the folder size on Windows is to hover the mouse pointer over the folder in the File Manager app. This will show the date created, time, folder size, and contents.

However, in case the feature isn’t working for you, here’s how to fix it.

Step 1: Press the Windows key and open the Windows search menu. Type File Explorer Options and hit Enter.

File explorer options

Step 2: Go to the View menu in the File Explorer options menu. Here, enable the Display file size information in the folder tips option.

Display folder info

Now, it’s important to keep in mind that this method is slightly unreliable. If the folder size is big in hundreds of GBs, you might not see the folder size immediately with this trick.

This trick will give you more details than the simple folder size on Windows 11. Most users use this trick to check the folder size, see the number of files, check hidden files, rename folders, advanced sharing options, among others. Here’s how to do it.

Step 1: Press the Windows + E keys to open Windows Explorer. Here, browse to the location of the folder whose size you wish to view. Then, simply right-click on it and select Properties from the context menu.

Select properties

And that’s it. You should now be able to see the folder name, size in GB and bytes, the number of files and folders within it, created time and date, attributes, and much more.

Folder size in properties

Method 3: Use a Third-Party App

In some cases, Windows can take a very long time to view the folder size, especially when it has to calculate and re-index its contents. Additionally, checking for minute details can be quite cumbersome. Thankfully, plenty of third-party software offers additional features that make the task easy for you.

Step 1: Download the TreeSize software, and install it on your Windows 11 PC.

Step 2: Once installed, simply right-click on the folder whose size you wish to view and select TreeSize Free.

Select treesize

Here, you will see a detailed breakdown of the parent folder with other folders and files. You will also be able to see how much percentage of space is acquired by a specific file or folder in the parent folder.

Treesize app

It’s a small detail but helps a lot in certain scenarios. Other than that, you can also select File Count and Percent in the menu bar and see additional details in the folder.

Was this helpful?

Thanks for your feedback!

The article above may contain affiliate links which help support Guiding Tech. The content remains unbiased and authentic and will never affect our editorial integrity.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Hklm software microsoft windows currentversion policies system localaccounttokenfilterpolicy
  • Windows server 2016 восстановление системных файлов
  • Spider agent for windows как удалить
  • Как добавить самоподписанный сертификат в доверенные windows
  • This program requires windows service pack 1 or later как исправить на виндовс 7