<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How Can I Determine the Percentage of Free Space on a Drive?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2007/10/15/hey-scripting-guy-how-can-i-determine-the-percentage-of-free-space-on-a-drive.aspx</link><description>Hey, Scripting Guy! How can I determine the percentage of free space available on the drive where a script is running? -- GS 
 Hey, GS. And hey, welcome to another edition of Scripting Guys Trivia , the Internet game show in which the Scripting Guys</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: How Can I Determine the Percentage of Free Space on a Drive?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2007/10/15/hey-scripting-guy-how-can-i-determine-the-percentage-of-free-space-on-a-drive.aspx#3335218</link><pubDate>Wed, 02 Jun 2010 09:10:47 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3335218</guid><dc:creator>Jordi Nin Gallego</dc:creator><description>&lt;p&gt;Hello, it&amp;#39;s too late to write answer, but there&amp;#39;s a direct solution:&lt;/p&gt;
&lt;p&gt;		If objWMIService Then&lt;/p&gt;
&lt;p&gt;			Set colDiskDrives = objWMIService.ExecQuery _&lt;/p&gt;
&lt;p&gt;				(&amp;quot;Select * from Win32_PerfFormattedData_PerfDisk_LogicalDisk Where &amp;quot; _&lt;/p&gt;
&lt;p&gt;					&amp;amp; &amp;quot;Name &amp;lt;&amp;gt; &amp;#39;_Total&amp;#39;&amp;quot;)&lt;/p&gt;
&lt;p&gt;			For Each objDiskDrive In colDiskDrives&lt;/p&gt;
&lt;p&gt;&amp;#39;				oFile.WriteLine &amp;quot;Drive &amp;quot; &amp;amp; objDiskDrive.Name &amp;amp; &amp;quot; on &amp;quot; &amp;amp; strComputer &amp;amp; &amp;quot; has &amp;quot; &amp;amp; objDiskDrive.FreeMegabytes &amp;amp; &amp;quot; MB (&amp;quot; &amp;amp; objDiskDrive.PercentFreeSpace &amp;amp; &amp;quot;%) Free&amp;quot;&lt;/p&gt;
&lt;p&gt;				oFile.WriteLine &amp;quot;Drive;&amp;quot; &amp;amp; objDiskDrive.Name &amp;amp; &amp;quot;;&amp;quot; &amp;amp; objDiskDrive.FreeMegabytes/1024 &amp;amp; &amp;quot;;MB;&amp;quot; &amp;amp; objDiskDrive.PercentFreeSpace &amp;amp; &amp;quot;%&amp;quot;&lt;/p&gt;
&lt;p&gt;			Next&lt;/p&gt;
&lt;p&gt;		Else&lt;/p&gt;
&lt;p&gt;			oFile.WriteLine &amp;quot;Could not connect to &amp;quot; &amp;amp; strComputer&lt;/p&gt;
&lt;p&gt;			oFile.WriteLine &amp;quot;objWMIService; #&amp;quot; &amp;amp; objWMIService &amp;amp; &amp;quot;#&amp;quot;&lt;/p&gt;
&lt;p&gt;		End If&lt;/p&gt;
&lt;p&gt;I expect that this code can solve a lot of problems&lt;/p&gt;
&lt;p&gt;Thansks!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3335218" width="1" height="1"&gt;</description></item></channel></rss>