Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP.exe to different VFP.exe
Message
From
12/02/2021 20:44:06
 
 
To
12/02/2021 17:03:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01678195
Message ID:
01678201
Views:
85
Likes (1)
>>
>>What is objwmiservice = Getobject("winmgmts:\\.\root\"+m.wmiclass)? I get Moniker cannot open file.
>
>Marco's program won't run in VFP6.
>
>You can call the class directly, then (with a little twist needed, don't ask me why...).
>
>
>LOCAL Processes
>LOCAL Process
>LOCAL WMIQuery
>LOCAL WMIService
>
>m.WMIService = GETOBJECT("winmgmts://.\root\cimv2")
>
>m.WMIQuery = "SELECT * FROM Win32_Process"
>m.Processes = m.WMIService.ExecQuery(m.WMIQuery, , 32)
>
>FOR EACH m.Process IN m.Processes
>
>	IF m.Process.Name == "VFP6.EXE"
>		? "VFP6 is running at", m.Process.ExecutablePath
>		EXIT
>	ENDIF
>
>ENDFOR
>
>
>PS - thinking about it again, it may seem more strange that "winmgmts:\\" is working, instead of ""winmgmts://"...

Hello Antonio -thanks for the appreciation!-
I always use ( and highly recommend ) MS WMI code creator ( https://www.microsoft.com/en-us/download/details.aspx?id=8572 )
to inspect what's available on wmi classes.. ( see attached image ) All this time I've used backslash as they do -
Now I see VFP9 works both ways ( using slash / backslash ) so I'll do the update -

Thanks.

Update:
Now I remember that VFP6 has no empty object - so vfp6 users would have to change "empty" for "line" .
@nfoxdev
github.com/nfoxdev
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform