Problem creating winmgmts using Visual FoxPro on XPe SP2

  • Thread starter Thread starter ehenderson
  • Start date Start date
E

ehenderson

We have an application written in VFP9 that we would like to start
using on an XPe system.
The application needs to check to see if a certain exe (process) is
running, and if it is not, then start it.

The line of code that we are using is that is giving the error on the
XPe system is:
objWMIService = GetObject("winmgmts:
{impersonationLevel=impersonate}root\cimv2")

This line of code runs just fine on a standard Windows XP SP2, but it
gives a 'moniker cannot open file' error when it is run on the XPe SP2
machine.

When I run the WBEMTest.exe from the WBEM folder, I am able to connect
to Root\cimv2, and get all of the instances of the winmgmnts through
that with not problem.

I have tried many different variations for the parameter for the
GetObject method.

Other things that I have checked are:
1. There is a CLSID key in the registry HKCR\CLSID
\{0000031A-0000-0000-C000-000000000046}
2. The Path in the Registry includes "%SystemRoot%\system32\WBEM"

I also created a small app that would return all of the current
processes to messageboxes using vb .net 2005, and it errored out,
saying that it could not create the ActiveX controls. This app also
works fine on Standard XP SP2 machines.

Any help would be greatly appreciated.
 
Back
Top