KickStarter15 Posted September 3, 2019 Share Posted September 3, 2019 (edited) Hi Experts, I have this little concern about processClose(), winKill() or even winClose() that these functions will not close my hidden program running from the computer. I added this "GUISetState(@SW_HIDE)" in my program to run it in silent mode or hidden from the user. However, when I tried updating the program and overwrite the old version to the new version (using other program "Updater.exe") it will not be deleted and still up and running in my Task manager. Now, the new version is running together with old version. My question is, how can I close the hidden program that is running in task manager. Here: I have commented my concerns. #include <MsgBoxConstants.au3> $sDis = @StartupDir & "\" ; where my program saved so that it will run automatically when user logged-in the PC If ProcessExists("JournalProcess.exe") Then ; Check if the the program is running. MsgBox($MB_SYSTEMMODAL, "", "It is running") ; checking if true ; now if it's running I need to close the program first tried these three but it's not working ProcessClose("JournalProcess.exe") WinKill($sDis & "JournalProcess.exe") WinClose($sDis & "JournalProcess.exe") ; after closing the JournalProcess.exe program I need to copy and run the updated version FileCopy() ; copy the program ShellExecute() ; run the program Else MsgBox($MB_SYSTEMMODAL, "Test", "It is not running") EndIf This is my task manager and the program JournalProcess is not closing. Note this program was run hidden using this GUISetState(@SW_HIDE). Please advise me Experts, I tried searching some reason why but I did not saw any. Thanks! KS15 Edited September 3, 2019 by KickStarter15 Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare. Link to comment Share on other sites More sharing options...
Nine Posted September 3, 2019 Share Posted September 3, 2019 I am using this on recalcitrant process : Local $ProcessName = "JournalProcess.exe" RunWait(@ComSpec & ' /c TaskKill /IM "' & $ProcessName & '" /F') KickStarter15 1 “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) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
KickStarter15 Posted September 3, 2019 Author Share Posted September 3, 2019 @Nine, Thanks, I found it in batch script coding to use same with what you've suggested but I preferred to follow your suggestion.🙂 Thanks! @echo taskKill /im JournalProcess.exe pause Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare. Link to comment Share on other sites More sharing options...
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