Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Neeraj Charne
  Where is Neeraj Charne?
 Indore
 India
 Neeraj Charne
 To: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 Tags
Subject: RE: Try to Terminate Exe from LAN
Thread ID: 416366 Message ID: 416406 # Views: 47 # Ratings: 2
Version: Visual FoxPro 9 SP2 Category: General VFP Topics
Date: Monday, December 29, 2014 8:54:40 AM         
   


> > Dear Experts,
> >
> > My client Network with 145 of PC.
> > I have Shared my ERP Exe on Each PC. ( Map Network ).
> >
> > When i want to Update Exe File on Server, i have to told all User to close the application. Every time EDP Person Call all the users and verify that they closed system or not..
> >
> > To avoid this ... i search a solution over the net .... and got a ready code...
> > Code work fine on Server ( Local Pc ... where it Run ) but not work ALL Network Pc.
> >
> > i am not able to understand what is the issue... and why user side exe was not terminating....
> >
> > Please see the Code.....
> > .....................
> >
> >
> > lcExeName = "notepad.exe" && Sample EXE Name
> >
> > * 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
> >
> >
> > *************
>
>
> I second Neeraj's suggestion of using a loader. This way you can do updates without bugging other users that won't be affected by such. All you need to do is copy your new exe with suffix of number such as myapp.01, myapp.02 and so on....
>
> The link then is not directly on your app but on the loader (rename it as the same name of your app). What the loader will do is it will check for the date and time stamp of the other exes, determine the latest and runs it.
>
> See this: http://www.ml-consult.co.uk/foxst-30.htm
>
>
>
> https://vfpx.codeplex.com/releases/view/99045
> http://sandstorm36.blogspot.com

I prefer a common small "Launch.exe" located on server which do the compare job

but application is in ".APP" form because our some smart? user
directly make shortcuts from the local pc whenever they not get shortcut(deleted due to any reason)
in that case they runs the old version.

so my suggestion is make application in "app" form.




I want to be a Student forever....

ENTIRE THREAD

Try to Terminate Exe from LAN Posted by Pravin Pawar @ 12/28/2014 12:20:43 PM
RE: Try to Terminate Exe from LAN Posted by Mike Gagnon @ 12/28/2014 1:49:20 PM
RE: Try to Terminate Exe from LAN Posted by Neeraj Charne @ 12/28/2014 2:26:21 PM
RE: Try to Terminate Exe from LAN Posted by Jun Tangunan @ 12/29/2014 1:18:33 AM
RE: Try to Terminate Exe from LAN Posted by Neeraj Charne @ 12/29/2014 8:54:40 AM
RE: Try to Terminate Exe from LAN Posted by Jun Tangunan @ 12/30/2014 5:02:36 AM
RE: Try to Terminate Exe from LAN Posted by Zia Mughal @ 12/29/2014 8:08:15 AM
RE: Try to Terminate Exe from LAN Posted by Ali Koumaiha @ 12/29/2014 3:24:07 PM
RE: Try to Terminate Exe from LAN Posted by Greg Green @ 12/29/2014 10:16:21 PM
RE: Try to Terminate Exe from LAN Posted by mk sharma @ 12/30/2014 6:40:08 AM