Windows Legacy OS forum

General discussion

Find free disk space from command line?

Does anyone know of a quick and simple way to get the amount of free disk space left on the HDD in WinXP Home? I need to use a batch file to monitor and record the remaining disk space at regular intervals.

Thanks,
~Chris

Discussion is locked
You are posting a reply to: Find free disk space from command line?
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: Find free disk space from command line?
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
dir command

In reply to: Find free disk space from command line?

At the end of every dir listing, there will be a line like the following:

9 Dir(s) 1,617,453,056 bytes free

You just need to figure out a way to scrape that info from within your program. Of course if you used a language like Perl, Python, or Ruby, there would likely be a built-in function for doing this... Or at the very least, it would be considerably easier to use regular expressions to extract just the bit of data you want.

Collapse -
Example one liner.

In reply to: Find free disk space from command line?

DIR | FIND "free"

Collapse -
why not use freedisk.exe

In reply to: Find free disk space from command line?

why not use freedisk.exe included in RK for server systems? Works well for xp too.

Collapse -
fsutil volume diskfree C:

In reply to: Find free disk space from command line?

My apologies for bringing this post back from the dead, but it does display in the top 3 in many google searches:

the solution:

fsutil volume diskfree C:

which returns something like:

Total # of free bytes : 230645665792
Total # of bytes : 266205130752
Total # of avail free bytes : 230645665792

Collapse -
cygwin compatibility freespace diskspace volumes

In reply to: fsutil volume diskfree C:

Thanks for this. I found fsutil output is compatible with a cygwin command line, so I was able to use this via ssh and sshd. As elegant as wmic capabilities are; it doesn't send it's output to the console through the normal output method, and so normal console utils won't interact with it's output.

Many thanks

Collapse -
wmic command to monitor remote PC

In reply to: Find free disk space from command line?

Popular Forums

icon
Computer Newbies 10,686 discussions
icon
Computer Help 54,365 discussions
icon
Laptops 21,181 discussions
icon
Networking & Wireless 16,313 discussions
icon
Phones 17,137 discussions
icon
Security 31,287 discussions
icon
TVs & Home Theaters 22,101 discussions
icon
Windows 7 8,164 discussions
icon
Windows 10 2,657 discussions

REVIEW

Sublime suburban chariot

High on style and technology, the 2019 Volvo XC90 is an incredibly satisfying everyday crossover.