Jump to content

[Solved] Closing Hide Program in Task Manager


Recommended Posts

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).

image.png.2e8fcc44bea488516359e1261b411cc7.png

 

Please advise me Experts, I tried searching some reason why but I did not saw any.

 

Thanks!

KS15

Edited 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

@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

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
 Share

  • Recently Browsing   0 members

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