Question

I have created a script to remap the Windows Button to right-mouseclick.

How can I create an executable AutoHotkey file that I can offer for download, that automatically runs only that script?

Was it helpful?

Solution

Why not use Ahk2exe? According to its docs, you can use it in three ways:

  1. GUI Interface: Run the "Convert .ahk to .exe" item in the Start Menu.

  2. Right-click: Within an open Explorer window, you can right-click any .ahk file and select "Compile Script" (only available if the script compiler option was chosen when AutoHotkey was installed). This creates an EXE file of the same base filename as the script, which appears after a short time in the same directory. Note: The EXE file is produced using the same custom icon, .bin file and use MPRESS setting that were last used by Method #1 above.

  3. Command Line: The compiler can be run from the command line with the following parameters:

    Ahk2Exe.exe /in MyScript.ahk [/out MyScript.exe] [/icon MyIcon.ico] [/bin AutoHotkeySC.bin] [/mpress 0or1]
    

For example:

    Ahk2Exe.exe /in "MyScript.ahk" /icon "MyIcon.ico"

Usage:

Parameters containing spaces should be enclosed in double quotes. If the "out" file is omitted, the EXE will have the same base filename as the script itself.

OTHER TIPS

Just want to add that, quoting from Convert a Script to an EXE (Ahk2Exe):

Once a script is compiled, it becomes a standalone executable; that is, AutoHotkey.exe is not required to run the script. The compilation process creates an executable file that contains the following: the AutoHotkey interpreter, the script, any files it includes, and any files it has incorporated via the FileInstall command. [v1.1.33+]: Additional files can be included using compiler directives.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top