i tried this code for checking the free space in C drive.
no error is comming. but not able to see the output. while i tried to display this in messagebox error is comming.
how can i display the output for us to see what's the free space...
Try
Dim connection As New ConnectionOptions
connection.Username = "userName"
connection.Password = "passWord"
connection.Authority = "ntlmdomain

OMAIN"
Dim scope As New ManagementScope( _
"\\FullComputerName\root\CIMV2", connection)
scope.Connect()
Dim query As New ObjectQuery( _
"SELECT * FROM Win32_LogicalDisk Where Name='C:'")
Dim searcher As New ManagementObjectSearcher(scope, query)
For Each queryObj As ManagementObject In searcher.Get()
Console.WriteLine("-----------------------------------")
Console.WriteLine("Win32_LogicalDisk instance")
Console.WriteLine("-----------------------------------")
Console.WriteLine("FreeSpace: {0}", queryObj("FreeSpace"))
Next
Close()
Catch err As ManagementException
MessageBox.Show("An error occurred while querying for WMI data: " & err.Message)
Catch unauthorizedErr As System.UnauthorizedAccessException
MessageBox.Show("Connection error (user name or password might be incorrect): " & unauthorizedErr.Message)
End Try
anyidea, please help me.
thanks in advance