BinRun()

Auto Hotkey

BinRun

Run a executable file (.exe) from memory.

OutputVar := BinRun(AddressOrPath , CommandLineParams, ScriptCommandLineParams, Hide, ExeToUse)
Command  Example: BinRun &MyExe;, "`nMsgBox `% A_Args.a", {a:"Hello World!"}
Function Example: PID := BinRun(&MyExe;, "`nMsgBox `% A_Args.a", {a:"Hello World!"})

Parameters

OutputVar

The name of the variable in which to store the process identifier (PID) of new process.

AddressOrPath

The address of a variable or a pointer to memory of the executable file (.exe).
This can be also a filepath or resource name, when both resource and filepath exist, resource takes precedence.

CommandLineParams (optional)

Command line parameters for the executable file (.exe).
This parameter can contain the text which will be loaded trough pipe. For example: "`nMsgBox `% A_AhkVersion"

ScriptCommandLineParams (optional)

Command line parameters for the script. This parameter can be an object as well. The object will be passed to new executable via ObjDump / ObjLoad.

Hide (optional)

True/1 to start process hidden otherwise 0/false/NULL.

ExeToUse

Executable to use as base for new process.
By default the executable of current process is taken and %A_WinDir% \Microsoft.NET\Framework\v2.0.50727\vbc.exe to launch 32-bit exe from 64-bit process.

Examples

FileRead,file,*c %A_AhkPath%
BinRun(&file;,"`nMsgBox `% A_Args.a",{a:"Hello World!"})

; same as above
BinRun(A_AhkPath,"`nMsgBox `% A_Args.a",{a:"Hello World!"})