G
Guest
Dear all,
I need to check the availbale disk space.
For that I have used following code :
m_diskMngt = New ManagementObject("win32_logicaldisk.deviceid=""E:""")
This works fine but as my drive letter can be something else, I try to use
the following :
m_LogDrive = Left(Path.GetPathRoot(sPath), 2)
mngObj = "'win32_logicaldisk.deviceid=" & Chr(34) & Chr(34) & m_LogDrive &
Chr(34) & Chr(34)
m_diskMngt = New ManagementObject(mngObj)
Using this get error message "Invalid parameter"
When I check the result string it is similar to the first one
Any idea what is wrong? or is there a simple way doing this?
thnaks for your help
regards
serge
I need to check the availbale disk space.
For that I have used following code :
m_diskMngt = New ManagementObject("win32_logicaldisk.deviceid=""E:""")
This works fine but as my drive letter can be something else, I try to use
the following :
m_LogDrive = Left(Path.GetPathRoot(sPath), 2)
mngObj = "'win32_logicaldisk.deviceid=" & Chr(34) & Chr(34) & m_LogDrive &
Chr(34) & Chr(34)
m_diskMngt = New ManagementObject(mngObj)
Using this get error message "Invalid parameter"
When I check the result string it is similar to the first one
Any idea what is wrong? or is there a simple way doing this?
thnaks for your help
regards
serge