PDA

View Full Version : Service.Query


DarrellBlack
03-11-2005, 03:42 AM
Hi All, unless I am missing another command the "Service.Query" is used to make sure a program is not running before trying to copy a new version into the same folder or on top of running .exe file.

I seem to not be able to get it work.

no quotes in real names

Windows title bar name = "DTS TDAS"
Windows process running name = "dts_tdas.exe"
Installed as = "TDAS CONTROL" for all shortcuts and for Windows uninstall

I have tried
sPRORUN = Service.Query("DTS TDAS", "")
sPRORUN = Service.Query("DTS TDAS", "DTS TDAS")
sPRORUN = Service.Query("DTS TDAS", "dts_tdas.exe")

I think a few more combos. what format do I use to return that it is running?

--Debug.Print(""..sPRORUN.."\n"); always returns a "0"

Brett
03-11-2005, 09:10 AM
Service actions are specifically for Windows services. To see if a process (or program) is running use Window.EnumerateProcesses. Do a search for "Window.EnumerateProcesses" on the forums here and you should come up with a bunch of results with how to do this sort of thing.

DarrellBlack
03-12-2005, 01:59 PM
Thanks, that was the hint I needed. Works Great.