Jump to content

Recommended Posts

Posted

What i want is to close all process with "name+any numbers.exe" like name1.exe, name2.exe.

$check = ProcessExists("name*.exe")
 
ProcessClose($check)

but not working any other way to do that?

Sry for my bad english.

Posted

This may help you.

Run("notepad.exe")
WinWaitActive("[CLASS:Notepad]")
Local $sString = "name"

Local $list = ProcessList()
For $i = 1 To $list[0][0]
    If StringRegExp($list[$i][0], "^note.*$") Then ProcessClose($list[$i][0])
    ;If StringRegExp($list[$i][0], "^" & $sString & "\d+\.exe$") Then ProcessClose($list[$i][0])
Next

; Note - ".*" in RE pattern, "." matches any character, and "*" causes the previous
;       character to be matched if repeated zero or many times.
;       "^" means beginning of string.
;       "$" means end of string. So using both "^" an "$" causes the entire string
;       to be compared, and not a matching sub-string.
;       StringRegExp() default parameter flag is zero which causes the return value
;       to be 1 or 0 only.
;       Regular expression are like an advanced evolved version of wildcards.
;
; To match "name+any numbers.exe" like name1.exe, name2.exe, try the RE pattern
; "^" & $sString & "\d+\.exe$", where $sString contains "name"

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...