XGamerGuide Posted December 22, 2020 Posted December 22, 2020 I'm trying to detect a background process. I have a main sript and i will mace a MsgBot, when the script crashes. I have a second Script which should scan whether the process is still running. But ProcessExists and FileExists dont work. These commands scan for a main script or file but not for a background script
Somerset Posted December 22, 2020 Posted December 22, 2020 You might need to provide more information (script), than this conglomerate post of confusion.
abberration Posted December 22, 2020 Posted December 22, 2020 ProcessExist should detect it, not FileExists. If your script is not compiled, you need to look for autoit.exe, not your script name. Basically, when you run task manager, if you can see the process there, then ProcessExists can detect it. Easy MP3 | Software Installer | Password Manager
XGamerGuide Posted December 22, 2020 Author Posted December 22, 2020 If Not ProcessExists("AutoIt3.exe") Then MagBox(0, "Error", "Main Script is close") EndIf When I scan for AutoIt3.exe, it is always recognized because the script which scans for the main script is itself an AutoIt3.exe application
Nine Posted December 22, 2020 Posted December 22, 2020 (edited) Ok change the hidden AutoIt title with AutoItWinSetTitle. You can then WinGetProcess easily. See help file and example to understand how to do it. Another option is to get ProcessList and kill those processes that are not equal to @AutoItPID (current process). Edited December 22, 2020 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
XGamerGuide Posted December 22, 2020 Author Posted December 22, 2020 When I use the AutoItWinSetTitle command, the task manager still says AutoIt3.exe and I still can't check the process with ProcessExists
Nine Posted December 22, 2020 Posted December 22, 2020 (edited) You did not study the examples in help file as I had suggested, did you ? Anyway, it is not very complicated. First script must do : AutoItWinSetTitle("My AutoIt Window") Second script will do : Local $hWnd = WinGetHandle("My AutoIt Window") If @error Then Exit ConsoleWrite ($hWnd & @CRLF) Local $iPID = WinGetProcess($hWnd) ConsoleWrite ($iPID & @CRLF) Local $iRes = ProcessClose ($iPID) ConsoleWrite ($iRes & "/" & @error & @CRLF) Edited December 22, 2020 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now