[Solved] Is it Possible to Set the "Image Name" of a Script? Topic is solved
- Buddha Nature
- Posts: 34
- Joined: 13 Feb 2022, 06:42
[Solved] Is it Possible to Set the "Image Name" of a Script?
I have a couple of scripts that I run on my system all the time. If I look in Windows Task Manager each script instance is shown as having the "Image Name", "AutoHotkey.exe". Is there a command/directive that one can include in a script to specify the Image Name of the script that will show in Windows Task Manager when the script is being run?
Last edited by Buddha Nature on 30 Apr 2022, 10:33, edited 1 time in total.
Re: Is it Possible to Set the "Image Name" of a Script?
I'm not sure about that, perhaps someone else will know...
However, compiling your script will allow you to set a custom icon and it will show the executable name in task explorer as well instead of autohotkey.exe.
However, compiling your script will allow you to set a custom icon and it will show the executable name in task explorer as well instead of autohotkey.exe.
Some of my AHK programs: 3D Voxel Game - Platformer Game
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
Re: Is it Possible to Set the "Image Name" of a Script?
You can also show the command line, which includes the path to the script.
- Buddha Nature
- Posts: 34
- Joined: 13 Feb 2022, 06:42
Re: Is it Possible to Set the "Image Name" of a Script?
Thank you Spawnova. Yes, I discovered the compile a script option which might be fine for most scripts.
However, one of the scripts I am using permanently is the excellent and truly useful AutoCorrect script and to get all its functionality — adding new autocorrect hotstrings and having the script auto-reload itself — it really is necessary to run it as a script and not as a compiled exe file.
However, one of the scripts I am using permanently is the excellent and truly useful AutoCorrect script and to get all its functionality — adding new autocorrect hotstrings and having the script auto-reload itself — it really is necessary to run it as a script and not as a compiled exe file.
Re: Is it Possible to Set the "Image Name" of a Script? Topic is solved
You can run a script that way by making a copy of AutoHotkey.exe. Rename the copy so that the file name matches the script's name; keep the .exe extension. Put both files into the same directory. You can then run the new copy of AutoHotkey that you have renamed.
Explained: Script filename
Explained: Script filename
Script Filename: This can be omitted if there are no Script Parameters. If omitted (such as if you run AutoHotkey directly from the Start menu), the program looks for a script file called AutoHotkey.ahk in the following locations, in this order: the directory which contains the AutoHotkey executable; the current user's Documents folder. The filename AutoHotkey.ahk depends on the name of the executable used to run the script. For example, if you rename AutoHotkey.exe to MyScript.exe, it will attempt to find MyScript.ahk. If you run AutoHotkeyU32.exe without parameters, it will look for AutoHotkeyU32.ahk.
- Buddha Nature
- Posts: 34
- Joined: 13 Feb 2022, 06:42
- Buddha Nature
- Posts: 34
- Joined: 13 Feb 2022, 06:42
Re: [Solved] Is it Possible to Set the "Image Name" of a Script?
Good to hear. Regarding Task Manager, you can right-click Name -> Select columns -> Command line. That will show the path to the process (program), as well as the path to the script file.