HermanCegel Posted December 7, 2022 Share Posted December 7, 2022 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 Link to comment Share on other sites More sharing options...
Subz Posted December 7, 2022 Share Posted December 7, 2022 (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 December 7, 2022 by Subz Link to comment Share on other sites More sharing options...
HermanCegel Posted December 7, 2022 Author Share Posted December 7, 2022 thanks for the replay, how about if i change calc.exe to Random.exe how do i know to close calc ? Link to comment Share on other sites More sharing options...
Developers Jos Posted December 7, 2022 Developers Share Posted December 7, 2022 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. Link to comment Share on other sites More sharing options...
HermanCegel Posted December 7, 2022 Author Share Posted December 7, 2022 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 Link to comment Share on other sites More sharing options...
HermanCegel Posted December 7, 2022 Author Share Posted December 7, 2022 i even use if winexists("cheat engine") then winclose("cheat engine") but the problem is they can change wintitle to random name Link to comment Share on other sites More sharing options...
Developers Jos Posted December 7, 2022 Developers Share Posted December 7, 2022 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. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 7, 2022 Developers Share Posted December 7, 2022 1 hour ago, HermanCegel said: ok, i want to protect my program from memory editor like cheatengine.exe This is not a topic we want to discuss 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. Link to comment Share on other sites More sharing options...
Recommended Posts