On Windows 10, I need to restart a window-manager running as MaxTo.exe. However, the following mapping does do the job as desired.

    WinKill ahk_exe MaxTo.exe
    run C:\Program Files\MaxTo\MaxTo.exe

Can anyone suggest what I did wrong? Putting another prime (,) after the WinKill command also does no help.

With WinKill ahk_exe gvim.exe, I can happily terminate any GVIM process. However, I can do nothing to this MaxTo.exe guy.

Are there known limitation of WinKill? The only difference between the two processes is that: I can see an icon for GVIM popping up in the taskbar region, yet when MaxTo is running, it only shows an active icon in the system tray.

Thank you in advance!

All the best,


  • "However, the following mapping does do the job as desired." That suggests you don't have a problem. Please edit and clarify your question. – DavidPostill Aug 13 '16 at 17:02

It is likely that the WinKill command does not work because there is no window associated with the process. Try using the Process command instead like this,

    process, exist, MaxTo.exe
    pid = %ErrorLevel%
    Process, Close, %pid%
    run "C:\Program Files\MaxTo\MaxTo.exe"
  • Fantastic. Your script worked like a breeze. Now, effectively, I can restart MaxTo.exe with one key-stroke. Thanks a lot! – llinfeng Aug 14 '16 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.