Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ending a process
#1
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?
#2
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:

Code:
Copy      Help
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
#3
Thanks alot Smile I'll try this out.
#4
Worked like a charm, thanks again.
#5
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.
#6
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.


Forum Jump:


Users browsing this thread: 1 Guest(s)