Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 71173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:50:46+00:00 2026-05-10T19:50:46+00:00

I want to get the size of a drive (or UNC path pointing to

  • 0

I want to get the size of a drive (or UNC path pointing to a partition would be nice, but not required), as well as free space for said drive (or UNC path). This doesn’t need to work cross platform; only in Windows.

I know it’s easy to do in Java 6, but that’s not an option; I’m stuck with Java 5.

I can get the free space available by doing:

cmd.exe /c Z:\ /-c

or

cmd.exe /c \\server\share /-c

and just parsing out the resulting bytes free. However I can’t seem to find a way to get the total drive size.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:50:47+00:00Added an answer on May 10, 2026 at 7:50 pm

    One way to do it would be to use fsutil on the command line. It returns something like this:

    D:\>fsutil fsinfo ntfsinfo c: NTFS Volume Serial Number :       0xd49cf9cf9cf9ac5c Version :                         3.1 Number Sectors :                  0x0000000004a813ff Total Clusters :                  0x000000000095027f Free Clusters  :                  0x00000000002392f5 Total Reserved :                  0x0000000000000490 Bytes Per Sector  :               512 Bytes Per Cluster :               4096 Bytes Per FileRecord Segment    : 1024 Clusters Per FileRecord Segment : 0 Mft Valid Data Length :           0x000000000e70c000 Mft Start Lcn  :                  0x00000000000c0000 Mft2 Start Lcn :                  0x0000000000000010 Mft Zone Start :                  0x0000000000624ea0 Mft Zone End   :                  0x0000000000643da0 

    Multipy your number of sectors times the bytes per sector to get your size.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 66k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I ended up using a little server-side preprocessing. This site,… May 11, 2026 at 11:28 am
  • added an answer Try this: $(function(){ $('.cpHeader').click(function() { $(this).next('.cpBody').slideToggle('fast'); }); }); If you… May 11, 2026 at 11:28 am
  • added an answer As a followup on Node's answer, I will post the… May 11, 2026 at 11:28 am

Related Questions

I want to get the size of a drive (or UNC path pointing to
I want to get the size of an http:/.../file before I download it. The
This isn't as malicious as it sounds, I want to get the current size
I want to get the MD5 Hash of a string value in SQL Server
I want to get the base 10 logarithm of a Fixnum using Ruby, but
I want to get the last result returned from this query. How do I
I want to get the method System.Linq.Queryable.OrderyBy<T, TKey>(the IQueryable<T> source, Expression<Func<T,TKey>> keySelector) method, but
I want to get the headers only from a curl request curl -I www.google.com
I want to get the progress of my AJAX request - how much has
I want to get the UCS-2 code points for a given UTF-8 string. For

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.