Listing all files on my computer and sorting by size

后端 未结 3 1347
遥遥无期
遥遥无期 2021-01-13 08:55

Recently I\'ve come into the problem that my hard drive is getting obnoxiously full, but after going through my personal files and deleting/moving all of the oversized video

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-13 09:32

    Does it have to be in c#? Try this from a command prompt: dir c: /B /O-S /S /4 /a-d > fileList.txt

    The dir command lists files, /B removes a bunch of info guff, /O-S displays the files in Order (by (S)Size (-)descending and goes through all subdirectories due to /S. The /4 bit just sets the year of files to four digits in case you have some from last century, and the /a-d weeds out the directory listings.

提交回复
热议问题