Jump to content

Recommended Posts

Posted

hello, my simple script is close program calculator

 

processclose('calc.exe')

 

i have question, what if i rename filename calc.exe to calc2.exe

is there a way to close calc2.exe without writing again processclose('calc2.exe')

 

thanks

Posted (edited)

Maybe something like:

_CloseCalc()
Func _CloseCalc()
    Local $aProcesses = ProcessList()
    For $i = 1 To $aProcesses[0][0]
        If StringLeft($aProcesses[$i][0], 4) = "Calc" And StringRight($aProcesses[$i][0], 4) = ".exe" Then
            MsgBox(4096, "", $aProcesses[$i][0])
            ;~ ProcessClose($aProcesses[$i][0])
        EndIf
;~      RegExp method
;~      If StringRegExp($aProcesses[$i][0], '(^Calc).*(.exe$)') Then
;~          MsgBox(4096, "", $aProcesses[$i][0])
;~          ;~ ProcessClose($aProcesses[$i][0])
;~      EndIf

    Next
EndFunc

 

Edited by Subz
  • Developers
Posted

Now you really need to explain what it is you are doing as this isn't really making any sense why this ever should happen!

What what are you really trying to do here?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

ok,  i want to protect my program from memory editor  like cheatengine.exe

 

so i use processclose('cheatengine.exe')

 

the problem is,  when they change cheatengine.exe to blablabla.exe,  i cannot close it

  • Developers
Posted

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Guest
This topic is now closed to further replies.
×
×
  • Create New...