Jump to content

Help whit ProcessExists


Recommended Posts

Gentlemen Good morning, today I ask you a little help to you with a check I'm trying to do, it is I want to run a .exe that I did, what I do is that before running check if it is already that open, am using ProcessExists, but what happens is that I just to run first mistake, I tried to do it in different ways, but I'm not.

$proceso = ProcessExists("aceptar ventanas business.exe")
If $proceso > 2 Then
   MsgBox(16,"Error","Ya esta abierto")
Else
while 1
If WinExists("Recuperando los datos...")Then
WinActivate("Recuperando los datos...")
Send("{enter}")
Else
EndIf
WEnd
EndIf

 

Link to comment
Share on other sites

  • Moderators

Your question is a bit vague; are you looking to ensure your script isn't run twice, or just making sure the program you're manipulating is already running?

If you don't want someone running your script twice, look at _Singleton in the help file.

If you're just looking to see if the external program is running, it should be a simple as something like this:

If ProcessExists(<external app process>) Then
    ;Do this
Else
    ;Do that
EndIf

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

 

Yes, as you write what he had done, but when I compile it to .exe and give start always tells me that is already running and do not start or first.
So I thought if I made him that if he was running more than twice gave me the error, but did not work well.
Excuse me if you think my question is vague but I was not born learned and that is why I come to this forum because of you I learned a lot.

In itself, what happens is that when you start the .exe it checks the process in TaskManager, then it is verified it and not start.

Edited by JuanFelipe
Link to comment
Share on other sites

  • Moderators

That is where the question gets muddied; I am sure it is a language barrier issue. You say

when you start the .exe it checks the process in TaskManager, then it is verified it and not start.

Am I correct in reading it like this?

When I launch my compiled script, I would like it to ensure that there is only a single copy of the script running. If there is already a copy of the script running, the second one will exit.

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

As J1 states (and I stated in my first response) look at _Singleton in the help file.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Thank you, you have taught me a lot and sorry if I ask questions that are very obvious to you, but there are things I do not understand the language, since I am from Colombia. Again thank you very much, it worked perfect me.

Link to comment
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
 Share

×
×
  • Create New...