Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Check Harddrive space and total drive listings for all servers

Posted on 2004-10-26
7
Medium Priority
?
199 Views
Last Modified: 2010-04-23
I have a list of servers (actual servers on our network) that I am returning from a SQL stored procedure query via a datareader - what I would like to do is to cycle through of the of records returened and check and display the harddrive space and drives on each of the servers - Is this even possible and if so, how?
0
Comment
Question by:tbaseflug
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 12411901
maybe look ,

here

http://www.freevbcode.com/ShowCode.Asp?ID=5588

or you could use WMI
0
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 12411921
sorry forgot the link for wmi

http://www.freevbcode.com/ShowCode.Asp?ID=1550
0
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 2000 total points
ID: 12412120
I see the link for WMI was for VB6,

but this is how it is done in .net (don't forget to reference system.management

Public Function GetDiskSpace() As System.UInt64
Dim diskClass As _
New System.Management.ManagementClass("Win32_LogicalDisk")
Dim disks As System.Management.ManagementObjectCollection = _
diskClass.GetInstances()
Dim disk As System.Management.ManagementObject
Dim space As System.UInt64
For Each disk In disks
If CStr(disk("Name")) = "C:" Then
space = CType(disk("FreeSpace"), System.UInt64)
End If
Next disk
Return space
End Function
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:tbaseflug
ID: 12412441
RonaldBiemans -

How would I displaythe results to a web page?
0
 

Author Comment

by:tbaseflug
ID: 12412463
Also, how would I use the above to reference a harddrive of a remote server?
0
 
LVL 6

Expert Comment

by:The_Biochemist
ID: 12416397
'create your string from the variables
Dim strOutput as string = disk & " has " & space & " kb Free"
'write it to the page
response.write(strOutput)
0
 
LVL 6

Expert Comment

by:The_Biochemist
ID: 12416451
in the interim before finding out how to  reference the drives on a remote server with code you could map them as local drives and set the permissions for ASPNET. It is not the best solution but certainly the easiest!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question