﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>A1VBCode Forums / Classic Visual Basic (VB 6 or earlier) / API  / Hard disk size / Latest Posts</title><generator>InstantForum.NET v4.1.1</generator><description>A1VBCode Forums</description><link>http://www.a1vbcode.com/vbforums/</link><webMaster>forums@a1vbcode.com</webMaster><lastBuildDate>Thu, 09 Feb 2012 04:40:02 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Hard disk size</title><link>http://www.a1vbcode.com/vbforums/Topic27768-5-1.aspx</link><description>You can refer to the following link :&lt;BR&gt;&lt;BR&gt;&lt;A href="http://vbnet.mvps.org/index.html?code/disk/deviodriveinfo.htm"&gt;http://vbnet.mvps.org/index.html?code/disk/deviodriveinfo.htm&lt;/A&gt; &lt;BR&gt;&lt;BR&gt;If you find difficulty in getting the code I can explain.</description><pubDate>Mon, 11 Jul 2011 01:53:31 GMT</pubDate><dc:creator>sunitasamal</dc:creator></item><item><title>RE: Hard disk size</title><link>http://www.a1vbcode.com/vbforums/Topic27768-5-1.aspx</link><description>&lt;div class="Quote"&gt;&lt;b&gt;Shreeti_Tula (6/10/2009)&lt;/b&gt;&lt;hr noshade size="1" class="hr"&gt;thanks. I may be wrong but as far as i know this api gives only the logical drive size. As for the example you have shown it gives the total size of c drive only. But i need the total size of harddisk i.e that may contain c,d,e... logical drive&lt;/div&gt;&lt;/P&gt;&lt;P&gt;Well to me the logical size is the actual size. I have a 40GB drive and it shows 40,006,156,288 Bytes and I have 28,899,593,344 Bytes free.&lt;/P&gt;&lt;P&gt;I only showed an example using C: drive but you could cycle through all the available fixed drives to find there size. &lt;img align="absmiddle" src="http://www.a1vbcode.com/vbforums/Skins/Classic/Images/EmotIcons/Wink.gif" border="0" title="Wink"&gt;</description><pubDate>Wed, 10 Jun 2009 16:36:10 GMT</pubDate><dc:creator>Keithuk</dc:creator></item><item><title>RE: Hard disk size</title><link>http://www.a1vbcode.com/vbforums/Topic27768-5-1.aspx</link><description>thanks. I may be wrong but as far as i know this api gives only the logical drive size. As for the example you have shown it gives the total size of c drive only. But i need the total size of harddisk i.e that may  contain c,d,e... logical drive</description><pubDate>Wed, 10 Jun 2009 08:19:18 GMT</pubDate><dc:creator>Shreeti_Tula</dc:creator></item><item><title>RE: Hard disk size</title><link>http://www.a1vbcode.com/vbforums/Topic27768-5-1.aspx</link><description>&lt;div class="Quote"&gt;&lt;b&gt;Shreeti_Tula (6/9/2009)&lt;/b&gt;&lt;hr noshade size="1" class="hr"&gt;I know there are lots of question being asked about this but i still have not found the solution. Can anybody help to find the total size of hard disk not the logical size. GetDiskFreeSpaceEx only helps to get the logical size. Please help..&lt;/div&gt;&lt;P&gt;Well I've always used &lt;STRONG&gt;GetDiskFreeSpaceEx&lt;/STRONG&gt; API to get the total drive size and the free space, its always worked for me. &lt;img align="absmiddle" src="http://www.a1vbcode.com/vbforums/Skins/Classic/Images/EmotIcons/Wink.gif" border="0" title="Wink"&gt;&lt;/P&gt;&lt;DIV style="BORDER-RIGHT: #000000 3px solid; PADDING-RIGHT: 25px; BORDER-TOP: #000000 3px solid; PADDING-LEFT: 25px; BACKGROUND-IMAGE: none; PADDING-BOTTOM: 25px; BORDER-LEFT: #000000 3px solid; PADDING-TOP: 25px; BORDER-BOTTOM: #000000 3px solid; BACKGROUND-COLOR: #cccccc"&gt;&lt;FONT color=#0000cc&gt;Option&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;Explicit&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#0000cc&gt;Dim&lt;/FONT&gt; Status &lt;FONT color=#0000cc&gt;As&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;Long&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000cc&gt;Dim&lt;/FONT&gt; TotalBytes &lt;FONT color=#0000cc&gt;As&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;Currency&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000cc&gt;Dim&lt;/FONT&gt; FreeBytes &lt;FONT color=#0000cc&gt;As&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;Currency&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000cc&gt;Dim&lt;/FONT&gt; BytesAvailableToCaller &lt;FONT color=#0000cc&gt;As&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;Currency&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000cc&gt;Dim&lt;/FONT&gt; DiskSize &lt;FONT color=#0000cc&gt;As&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;String&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#0000cc&gt;Dim&lt;/FONT&gt; DiskSpace &lt;FONT color=#0000cc&gt;As&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;String&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#0000cc&gt;Private&lt;/FONT&gt; Declare &lt;FONT color=#0000cc&gt;Function&lt;/FONT&gt; cc Lib "kernel32" Alias "GetDiskFreeSpaceExA" (&lt;FONT color=#0000cc&gt;ByVal&lt;/FONT&gt; lpDirectoryName &lt;FONT color=#0000cc&gt;As&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;String&lt;/FONT&gt;, lpFreeBytesAvailableToCaller &lt;FONT color=#0000cc&gt;As&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;Currency&lt;/FONT&gt;, _&lt;BR&gt;lpTotalNumberOfBytes &lt;FONT color=#0000cc&gt;As&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;Currency&lt;/FONT&gt;, lpTotalNumberOfFreeBytes &lt;FONT color=#0000cc&gt;As&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;Currency&lt;/FONT&gt;) &lt;FONT color=#0000cc&gt;As&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;Long&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#0000cc&gt;Private&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;Sub&lt;/FONT&gt; Command1_Click&lt;BR&gt;&lt;BR&gt;Status = GetDiskFreeSpaceEx("C:\", BytesAvailableToCaller, TotalBytes, FreeBytes)&lt;BR&gt;&lt;FONT color=#0000cc&gt;If&lt;/FONT&gt; Status = 0 &lt;FONT color=#0000cc&gt;Then&lt;/FONT&gt;&lt;BR&gt;    DiskSize = "Unknown"&lt;BR&gt;    DiskSpace = "Unknown"&lt;BR&gt;&lt;FONT color=#0000cc&gt;Else&lt;/FONT&gt;&lt;BR&gt;    DiskSize = &lt;FONT color=#0000cc&gt;Format&lt;/FONT&gt;(TotalBytes * 10000, "#,##0") &amp;amp; " Bytes"&lt;BR&gt;    DiskSpace = &lt;FONT color=#0000cc&gt;Format&lt;/FONT&gt;(FreeBytes * 10000, "#,##0") &amp;amp; " Bytes"&lt;BR&gt;&lt;FONT color=#0000cc&gt;End&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;If&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;MsgBox "Disk Size: " &amp;amp; DiskSize&lt;BR&gt;MsgBox "Free Space: " &amp;amp; DiskSpace&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#0000cc&gt;End&lt;/FONT&gt; &lt;FONT color=#0000cc&gt;Sub&lt;/FONT&gt;&lt;BR&gt;&lt;/DIV&gt;</description><pubDate>Wed, 10 Jun 2009 07:26:16 GMT</pubDate><dc:creator>Keithuk</dc:creator></item><item><title>RE: Hard disk size</title><link>http://www.a1vbcode.com/vbforums/Topic27768-5-1.aspx</link><description>&lt;FONT color=#111111&gt;Have you tried GetFileInformationByHandle?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#111111&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;P&gt;&lt;FONT color=#111111&gt;Good Luck&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#111111&gt;&lt;/FONT&gt; </description><pubDate>Wed, 10 Jun 2009 04:28:50 GMT</pubDate><dc:creator>vb5prgrmr</dc:creator></item><item><title>Hard disk size</title><link>http://www.a1vbcode.com/vbforums/Topic27768-5-1.aspx</link><description>I know there are lots of question being asked about this but i still have not found the solution. Can anybody help to find the total size of hard disk not the logical size. GetDiskFreeSpaceEx only helps to get the logical size. Please help..</description><pubDate>Tue, 09 Jun 2009 05:05:36 GMT</pubDate><dc:creator>Shreeti_Tula</dc:creator></item></channel></rss>
