StdoutToVar

Author: Sean Last Modified: 20081005


Redirects the output of a command or application into one of the script's variables.

StdoutToVar_CreateProcess(sCmd, bStream = "", sDir = "", sInput = "")
StdoutToVar_CreateProcessCOM(sCmd, bStream = False, sDir = "", sInput = "")

For the functions's parameters and return value, please see it's source code.

Remarks

This is not stdlib conform, because it uses global variables. Aloso it does have some global subroutines. These routines are g labels. The script must be included after global return, the auto-exection section.

There are some modifications around. Look at discussion page 2.

For update's details and remarks related to the functions, please see the AutoHotkey Forum: http://www.autohotkey.com/forum/viewtopic.php?t=19021

For update's details and remarks related to the functions, please see the AutoHotkey Forum: http://www.autohotkey.com/forum/topic16823.html

License

nonexistent

Example

; #Include StdoutToVar.ahk
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

MsgBox % StdoutToVar_CreateProcess("ipconfig.exe /all")
MsgBox % StdoutToVar_CreateProcess("ping.exe www.autohotkey.com", True)