Jump to content
Sign in to follow this  
Xphere

I need help for a easy solution

Recommended Posts

i posted this in v2 support, but i have both v2 and v3

heres what i posted please help me

this is concerning a exe that does not generate a window, its only a process i need to monitor for.

-------------------------------------

I have quite a few customers that just plainly are a pain in the butt. Im sure you all know those people that no matter how many times you tell them to just click once, they seem to need to click something 45 times.

I will continue my search on the best way to do this, but i wanted to post what i am trying to do because i am in a time crunch and any help i can get the better..

Im very new to autoit, ive only made one script that just basically closes a window and refocuses the appropriate window for the user.. (its amazing how some people can get lost on their desktop)

anyway

what im trying to do is, either 1. have a script that always runs, and waits for a particular exe to show up in processes, and makes sure that, it doesnt run too long, and if more then 1 of them exist for more then 3 seconds, then it just kills the exe.

Im reading through the help and the forums now, but any help i can get would really be great, thank you for your time

----------------------------------------

Share this post


Link to post
Share on other sites

thank you for responding..

actually the v3 help was much more informative then the v2 help. (no offense to anyone)

so i was able to find exactly what i was looking for. processexist and processclose

again thank you so much

Share this post


Link to post
Share on other sites

actually the v3 help was much more informative then the v2 help. (no offense to anyone)

No offense taken I'm sure. V2 is old, and no longer properly supported. V3 has a constantly updating help file, people are reporting bugs of all sizes (sometimes errors in the syntax, sometimes misspelled words) every day.

Share this post


Link to post
Share on other sites

you may want to look at timerinit() and timerdiff() for the 3sec part

i.e.:

#NoTrayIcon
Dim $stexe, $anexe
While 1
If ProcessExists("something.exe") Then $stexe = timerinit()
If ProcessExists("another.exe") Then $anexe = timerinit()

While $stexe <> "" OR $anexe <> ""
If (timerdiff($stexe)/1000) >= 3 Then ProcessClose("something.exe")
If (timerdiff($anexe)/1000) >= 3 Then Process Close("another.exe")
Dim $stexe = "", $anexe = ""
WEnd
WEnd

Hope that helps


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites

<snipped>

what im trying to do is, either 1. have a script that always runs, and waits for a particular exe to show up in processes, and makes sure that, it doesnt run too long, and if more then 1 of them exist for more then 3 seconds, then it just kills the exe.

<snipped>

<{POST_SNAPBACK}>

I'm not positive that I understand your description of the task at hand. I'm not picking at your English, but it makes a difference on what the script is to do and hence the advice offered within a reply to your post.

You used the word "either" but then I do not see an "or" in the paragraph... just a bunch of "ands". I assume that this part, "...and if more then 1..." is where you might have meant, "...or 2. if more than 1..."

You could have both if you wish:

1. Script will always run and kill a process if it is open too long

AND

2. Script will also check for duplicate or multiple occurrences of this same process

If found for more than 3 seconds, then kill the duplicates

The only thing that I would add to the info that others have posted... you might want to look at the function named "AdlibEnable" to call a user defined function that might include "ProcessList" to check for and kill any "duplicates".

Again, not picking at your English, I'm just not sure that I understood the task at hand.


[size="1"][font="Arial"].[u].[/u][/font][/size]

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...