0

I'm need to essentially get the summary of "DIR/s" but without listing. I want to be able to see the number of files/folders/bytes used and bytes available - and pipe all that to a file?

2 Answers2

1
@echo off
setlocal EnableDelayedExpansion
for /F %%a in ('dir') do (
   set files=!dirs!
   set dirs=%%a
)
echo %files% Files(s), %dirs% Dir(s)

Previous Batch file may be easily modified to get the number of used and available bytes, if required.

Antonio

Aacini
  • 65,180
  • 12
  • 72
  • 108
0

While this can be done using command-line scripting it's FAR easier using PowerShell.

Without knowing what information you want to collect per folder and as a summary, it's not possible to provide a worked solution right now.

However, I'd encourage you to read through and experiment with the scripts and answers provided in the following threads:

HTH.

Community
  • 1
  • 1
Rich Turner
  • 10,800
  • 1
  • 51
  • 68
  • Ah thanks! What I mean is this 667 File(s) 37,487,015,901 bytes 392 Dir(s) I've omitted the bytes free as it isn't really required in this instance. Even the bytes used is optional, its more the count of files and directories. Similar to what you'd see if you right-click> Properties in a windows directory. – Eddi Calaguas Feb 28 '13 at 01:24
  • @RichardTurner: I don't think that the solution to this problem be "FAR easier using PowerShell". I even think that my Batch solution is easier than any equivalent PowerShell one... – Aacini Feb 28 '13 at 05:47