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 197079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:49:19+00:00 2026-05-11T16:49:19+00:00

I am attempting to determine the amount of free space a CD has using

  • 0

I am attempting to determine the amount of free space a CD has using the following code:

ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_LogicalDisk WHERE DriveType =5");
foreach(ManagementObject mo in searcher.Get())
{
    Console.WriteLine( "FreeSpace: "+mo["FreeSpace"].ToString());
    Console.WriteLine("CapacitySpace: " + mo["Size"].ToString());
    UInt64 usedspace = (UInt64)mo["Size"] - (UInt64)mo["FreeSpace"];
    Console.WriteLine("UsedSpace: " + usedspace.ToString());
}

Running the above code, I receive the following output:

FreeSpace: 0
CapacitySpace: 301463552
UsedSpace: 301463552

Ideally, I’d like to report the Windows Explorer statistics – XXX of YYY free. Please note that Windows Explorer is reporting 392 MB free of 702 MB. Thanks!

Update (1 Apr 09):
It appears the capability of determining a CD’s free space is beyond the WMI and is reliant on the file system of the disk inserted. My testing indicates that Windows will not display capacity information for CDs formatted CDFS; however, it will display capacity information for CDs formatted UDF.

Also, I located an excellent native utility for browsing the WMI referenced here.

  • 1 1 Answer
  • 1 View
  • 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. Editorial Team
    Editorial Team
    2026-05-11T16:49:20+00:00Added an answer on May 11, 2026 at 4:49 pm

    Are you attempting to determine the amount of space unused from the theoretical max available of a CD?

    My understanding is that a CD-ROM is a read-only format, and thus will never have any free space. Every bit is used for data already written, no more can be written to it, so there will never be space available.

    If you just want to know the unwritten space on a ROM, simply subtract the used space from the fixed theoretical max (702MB?), and there you have it. The fixed max should be part of a spec somewhere.


    Have you looked into using mciSendString() on the device, possibly with the “info” or “status” strings, to get further information on the disc in the drive? I haven’t tried this myself, so I’m not sure it will work.

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

Sidebar

Related Questions

I'm attempting to create a custom control that inherits from System.Web.UI.WebControls.ListView . Codebehind: using
I am trying attempting to refactor the following code: public static void SaveSplitbar(RadSplitBar splitBar)
I'm new to OpenCV (am actually using Emgu CV C# wrapper) and am attempting
I'm attempting to detect when my application has been upgraded using a BroadcastReceiver and
I've got some legacy dataset code which I'm updating. I'm attempting to determine if
I am attempting to rewrite some code that was using FileSearch for Excel 2003
I am attempting to determine prior art for the following idea: 1) user types
Attempting to use the data series from this example no longer passes the JSONLint
Attempting to build a C# project which has numerous references to assemblies in NuGet
Attempting to change the files folder location in a Drupal site from /files to

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.