Sign in to follow this  
Followers 0
MIN

Processexists(如何检测进程是否重复执行?)

8 posts in this topic

How to check process ,Can't run again

If ProcessExists("autoit3.exe") Then
    MsgBox(0, "Wrong", "autoit3 is running.,Can't run again")
EndIf

Share this post


Link to post
Share on other sites



while 1
If ProcessExists("autoit3.exe") then
Processclose("autoit3.exe")
Msgbox(0,"Wrong","Autoit3 is already running, Can't run again")
endif
wend

Share this post


Link to post
Share on other sites

Your probably looking for a Semaphore, look up _SingleTon() in the Beta help file.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

您只想要一个时后只有一个program, 是不是?

AutoIt 帮助文件有这个例子:

$Version = "My Script"
If WinExists($g_szVersion) Then Exit;已经有
AutoItWinSetTitle($g_szVersion)

fang ta 在前面.

English Translation (英文译文):

You only want one program to be running at one time, am i right?

From the AutoIt Help file:

Put it at the front of your script.

#)

EDIT: Forgot to mention that this is my first post after my absence from the forums for 1-2 months... not to say that it's long or anything... but things here happen so fast. What's the current beta version?

Edited by nfwu

Share this post


Link to post
Share on other sites

EDIT: Forgot to mention that this is my first post after my absence from the forums for 1-2 months... not to say that it's long or anything... but things here happen so fast. What's the current beta version?

Shows this as your last post 9 days ago :think: ... but welcome back all the same.

nfwu Posted on: Apr 19 2006, 08:17 AM

3.1.120 I believe is the latest beta.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

no

28th April, 2006 - v3.1.1.121 (beta)

:think: just released today

Share this post


Link to post
Share on other sites

no

28th April, 2006 - v3.1.1.121 (beta)

:think: just released today

It was released 5 hours after I posted!

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

That is OK,Thanks.

$var = ProcessList("autoit3.exe")
If $var[0][0] >1 Then
MsgBox(0,"错误","本程序已经运行,请不要重复执行")
EndIF
Exit.

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  
Followers 0