Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running vfp on windows 7 - system info - can't collect
Message
 
 
To
26/02/2011 23:42:30
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01501966
Message ID:
01501983
Views:
63
Check Check if exe is running and optionally terminate it

I have no problems running that script.

>I have a little more info that may help:
>
>I issued this from a VFP app I am running:
>
>&& In case the COM's did not release properly, kill them.
> lcComputer = '.'
> loWMIService = Getobject('winmgmts:' ;
> + '{impersonationLevel=impersonate}!\\' + lcComputer + '\root\cimv2')
> lcprocname="ITFCOMLEFT.EXE"
> colProcessList = loWMIService.ExecQuery([Select * from Win32_Process where Name="]+lcProcName+["])
> For Each loProcess In colProcessList
> IF UPPER(loProcess.name) = lcprocname
> loProcess.terminate()
> endif
> NEXT
> lcprocname="ITFCOMRGHT.EXE"
> colProcessList = loWMIService.ExecQuery([Select * from Win32_Process where Name="]+lcProcName+["])
> For Each loProcess In colProcessList
> IF UPPER(loProcess.name) = lcprocname
> loProcess.terminate()
> endif
> NEXT
>
> WAIT CLEAR
>
> loWMIService=.NULL.
> RELEASE loWMIService
> RELEASE colProcessList=.NULL.
> RELEASE colProcessList
> RELEASE loProcess
>
>VFP generates an error on the "colProcessList = loWMIService.ExecQuery([Select * from Win32_Process where Name="]+lcProcName+["])
>" line of code.
>
>colprocessList is an object (can't see what is in it), but it appears the loWMIService may not "understand" the ExecQuery command or something. loProcess does NOT become an object.
>
>Perhaps the '\root\cimv2' is not good or something? I have no idea what '\root\cimv2' means.
>
>John
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform