Here you are:<br><br> >>> from win32com.client import GetObject<br>>>> wmiObj = GetObject("winmgmts:\\\\MGW01641\\root\\cimv2")<br>>>> diskinfo = wmiObj.ExecQuery("Select * from Win32_LogicalDisk")
<br>>>> for disk in diskinfo:<br>...    print disk.Name, disk.FreeSpace<br>...<br>A: None<br>C: 16978259968<br>D: None<br>>>><br><br><div><span class="gmail_quote">On 28 Feb 2007 12:26:31 -0800, <b class="gmail_sendername">
<a href="mailto:kevinliu23@gmail.com">kevinliu23@gmail.com</a></b> <<a href="mailto:kevinliu23@gmail.com">kevinliu23@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
HI,<br><br>I am new to Python and wanted to know how to check for the remaining<br>disk space on my Windows machine using Python? I was thinking of using<br>the command line "dir" and trying to extract the output from there.
<br>But I'm not sure how to extract command line strings using Python<br>either.<br><br>Anyway help would be appreciated. :)<br><br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list">http://mail.python.org/mailman/listinfo/python-list
</a><br></blockquote></div><br>