Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exe grabbed
Message
From
11/07/2010 12:31:21
 
 
To
11/07/2010 09:43:16
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01472182
Message ID:
01472191
Views:
57
No trace of vfp running in the processes at all.

>>Hi,
>>I have an exe file generated by vfp and what it only does is to collects data from our local network drives.
>>Sometimes it stops working because the network crashes. In the cases when I close the exe file I cannot
>>start it again because it says the exe is still running. I check the task manager but there's no
>>exe running with this file name. The only thing I could do is to restart the computer and that solves
>>the problem.
>>I find the snippet below to check the exe running, but it is also returns false..
>>
>>
>>lcExeName = "odosz.exe"
>> 
>>* Is EXE running
>>? IsExeRunning(lcExeName)
>>...
>>* Terminate EXE if it's running
>>? IsExeRunning(lcExeName, .T.)
>>...
>>RETURN
>> 
>>FUNCTION IsExeRunning(tcName, tlTerminate)
>>LOCAL loLocator, loWMI, loProcesses, loProcess, llIsRunning
>>loLocator 	= CREATEOBJECT('WBEMScripting.SWBEMLocator')
>>loWMI		= loLocator.ConnectServer() 
>>loWMI.Security_.ImpersonationLevel = 3  		&& Impersonate
>> 
>>loProcesses	= loWMI.ExecQuery([SELECT * FROM Win32_Process WHERE Name = '] + tcName + ['])
>>llIsRunning = .F.
>>IF loProcesses.Count > 0
>>	FOR EACH loProcess in loProcesses
>>		llIsRunning = .T.
>>		IF tlTerminate
>>			loProcess.Terminate(0)
>>		ENDIF
>>	ENDFOR
>>ENDIF
>>RETURN llIsRunning
>>
>>Is there another option to check what grabs the exe file?
>
>Is vfp9.exe running under processes? If you change your query to see all processes, do you see your exe in there then? (Wondering if the query is not returning it when it should because of case difference or length of string or something)...
Previous
Reply
Map
View

Click here to load this message in the networking platform