[英]Get first level items size in Windows cmd
I want to list only the first level folders sizes of a giving folder. 我只想列出给定文件夹的第一级文件夹大小。 Dir /s will also display is going deep and displays dir command of all sub folders and files as well.
Dir / s还将显示内容,并显示所有子文件夹和文件的dir命令。 But I need something like
但是我需要这样的东西
Dir FolderName
Resulting: 导致:
SubFlder1 1G, SubFolder2 2G etc. SubFlder1 1G,SubFolder2 2G等
Some details: 一些细节:
I am in the middle of reinstalling windows that went wrong, and the "old" system partition (c:) was deleted 我正在重新安装出错的Windows,并且删除了“旧”系统分区(c :)
I want to explore the "old" D: partition to backup data before continue 我想探索“旧的” D:分区以备份数据,然后再继续
Thus I can only use the Win10 installation command line utility (opened with shift+F10 in the activation code screen that is displayed at the beginning of the installation process), or of course any another utility available during installation. 因此,我只能使用Win10安装命令行实用程序(在安装过程开始时显示的激活码屏幕中以shift + F10打开),或者当然可以使用安装期间可用的任何其他实用程序。
Is it possible somehow? 有可能吗?
tx TX
To demonstrate my one liner, current directory is Q:\\Test 为了演示我的班轮,当前目录是Q:\\ Test
Q:\Test> tree 2017
Q:\TEST\2017
├───01
├───02
├───03
└───04
Q:\Test> For /d %A in (2017\*) do @Dir %A /A-D 2>Nul|find /V "/"|find /v "Dir("|find /V "Vol"
Directory of Q:\Test\2017\01
Directory of Q:\Test\2017\02
2 File(s) 414.805 bytes
Directory of Q:\Test\2017\04
Directory of Q:\Test\2017\03
1 File(s) 171 bytes
two issues with that 有两个问题
%A
should be encapsulated in double quotes in case folder name contains space. %A
封装在双引号中。 Took me a while to understand that. Dir
approach fits here. Dir
方法是否适合此处。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.