Probably asked a thousand times...

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Tourless
Pro Scripter
Posts: 69
Joined: Wed Jun 14, 2017 1:53 am
Location: NY

Probably asked a thousand times...

Post by Tourless » Wed Jun 14, 2017 2:12 am

Hi Folks,

I'm looking for a way to detect if a program is running and if it is close it. It could be a programmatic close of the program or a force quit, whichever would be more reliable. If the program is not found to be running then I want to simply continue on with my script. Basically I want to make sure Outlook is closed before I start my process.

thanks in advance.

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Probably asked a thousand times...

Post by JRL » Wed Jun 14, 2017 3:43 am

Code: Select all

Let>Looptimes=0
Label>CheckOutlook
ProcessExists>outlook.exe,vOutlookRes
If>vOutlookRes=True
  KillProcess>outlook.exe
  Add>LoopTimes,1
  If>LoopTimes>10
    MDL>Outlook is failing to close.  Exiting script
    Exit>0
  EndIf
  Wait>0.5
  Goto>CheckOutlook
EndIf

Tourless
Pro Scripter
Posts: 69
Joined: Wed Jun 14, 2017 1:53 am
Location: NY

Re: Probably asked a thousand times...

Post by Tourless » Wed Jun 14, 2017 11:19 am

Thanks JRL, that was exactly what I needed. Can't wait to start diving deeper!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts