Closing a Running Program Based With a Specified Path Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Closing a Running Program Based With a Specified Path

11 Jun 2021, 07:45

I have multiple copies of a portable program which are stored in different directories. When I launch these copies, multiple instances of the program are launched. They have identic .exe files and the same window titles. Therefore, in order to interact with a specific program among them, AutoHotkey needs to know the path to its .exe file, in order to differentiate it from the rest of the copies with the same window titles. What commands can be used to ascertain whether a program with a specified path is running, and if so, to close it?
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Closing a Running Program Based With a Specified Path

11 Jun 2021, 11:43

That is interesting about the full path.

Example is below.

Code: Select all

WinClose, ahk_exe %A_WinDir%\System32\notepad.exe
Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Re: Closing a Running Program Based With a Specified Path

12 Jun 2021, 08:56

mikeyww wrote:
11 Jun 2021, 11:43
That is interesting about the full path.

Example is below.

Code: Select all

WinClose, ahk_exe %A_WinDir%\System32\notepad.exe
Thank you. This makes it possible to interact with programs with different paths but the same title and file names.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput and 336 guests