Invalid Namespace

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a program that is being used by many users, but one is getting an
exception of "Invalid Namespace". I have no idea why or how to fix this
problem. The following is the code that is being used:

Dim disk As New System.Management.ManagementObject
_("Win32_LogicalDisk.DeviceID=""C:""")
disk.Get()

The error is occuring on the .Get function. The user is running Windows98,
and I had to run the wmi9x.exe file to get WMI installed. Could the WMI be
some how corrupted and if so, how can it be fixed, would running the
wmi9x.exe file again fix this problem? I am not sure if the user is running
Windows 98 or Windows 98 Second Edition, does WMI work on plain Win98 or only
on Second Edition and up?

Any info about this error and how to fix it would be greatly appreciated.

Mark
 
This page is for the WMI download for Windows 95/98/98 SE:

http://www.microsoft.com/downloads/...BA-337B-4E92-8C18-A63847760EA5&displaylang=en

Direct link to the file (3029 KB):

http://download.microsoft.com/download/platformsdk/wmi9x/1.5/W9X/EN-US/wmi9x.exe

You need to be running Internet Explorer 5 or above

----------------------

I created a simple project in VB.NET 2003:

1) Start a new Windows application

2) Add a reference to the System.Management DLL

3) Add the following inport:

Imports System.Management

4) Add a button, double-click it & paste in the following code:

Dim mo As New ManagementObject( "Win32_LogicalDisk.DeviceId='C:'")
mo.Get()
Dim ulngFreeSpace As UInt64 = CType(mo("FreeSpace"), UInt64)
MessageBox.Show(ulngFreeSpace.ToString())

5) Run it. The result is irrelevant, but it just to see if it works on the
Windows 98 machine

I hope this helps

Crouchie1998
BA (HONS) MCP MCSE
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top