Jump to content
Sign in to follow this  
Arbie

Need script to periodically stop then restart a process

Recommended Posts

Arbie

I use AutoIt so infrequently that I feel like a newbie every time.  It takes me hours to even get my bearings again.  So, I'm asking here once in case anyone has done this or can type out an outline in 2 minutes.  It is pretty simple in concept.  All my forum searches find stuff that's much more complicated, and I get a headache just trying to figure out what bits I could use.

I have a process / app called "NetMeter.exe".  It's window title is "Netmeter".  I need to kill it and restart it every 30 minutes or so, as a brute force fix for another issue.  I am now doing this manually but want to automate it.

Any quick help on this?  Thanks very much.

Share this post


Link to post
Share on other sites
water

ProcessClose and Run?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
mikell

AdlibRegister("MyFunc", 30*60*1000) ?

Share this post


Link to post
Share on other sites
Arbie

Well, thanks for answering and I guess those are commands I can try to use.  But the info is too cryptic to be of immediate help.  Looks like another learning session is in order. I'll figure it out.

Share this post


Link to post
Share on other sites
mikell

Well... something like this then

HotKeySet("{ESC}", "Terminate")

AdlibRegister("MyFunc", 30*60*1000)   ; 30 mn

Func MyFunc()
  ProcessClose("NetMeter.exe")
  Sleep(1000)
  Run( .....\NetMeter.exe")  ; <<<<< full path here
EndFunc 

Func Terminate()
    Exit 
EndFunc

Share this post


Link to post
Share on other sites
Arbie

Thanks very much!  I actually wouldn't have figured out most of that.  I appreciate your time and expertise.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×