Posts: 3
Threads: 1
Joined: Aug 2006
I'm new to QM and I have been searching through the for an anwser to this: Is there a macro command to end a process? For programs that have a window it's easy to just use the "close window" command but what about processes sitting in the sys tray. Also, is there a command to stop/start a service?
Posts: 12,092
Threads: 142
Joined: Dec 2002
To end process, use ShutDownProcess or ShutDownProcess2. For more info search the forum.
To work with services, use classes from Services type library. Examples are in Samples2 file which is in Installed Files subfolder. Import it. One of examples:
Services.clsService se._create
BSTR s="System Restore Service"
se.DisplayName=s
sel(list("Start[]Stop" s))
,case 1 se.StartService
,case 2 se.StopService
Posts: 3
Threads: 1
Joined: Aug 2006
Thanks alot
I'll try this out.
Posts: 3
Threads: 1
Joined: Aug 2006
Worked like a charm, thanks again.
Posts: 44
Threads: 12
Joined: Apr 2006
I am having issues with ShutDownProcess as it shuts down the first instant of the program even if its on an inactive user..
How do I use it so it only shuts down the program on the active user.
Heres the code im using;
str note.getwinexe(win("Notepad"))
ShutDownProcess note
is there any code to add that would shutdown the process that is running on active user and leave inactive user processes alone.
Posts: 12,092
Threads: 142
Joined: Dec 2002
Use window handle instead of program name.
ShutDownProcess win("Notepad")
When using program name, ShutDownProcess should fail when trying to terminate a process running in other user session.