I am automating a remote command prompt, using Ruby and AutoIt. The AutoIt part looks like this: $title = $CmdLine[1] $command = $CmdLine[2] AutoItSetOption("WinTitleMatchMode", 4) $firstWindowHandle = WinGetHandle($title) If $firstWindowHandle Then WinActivate($firstWindowHandle) ControlSend("","",$firstWindowHandle,$command) WinSetState($title,"",@SW_MINIMIZE) Else MsgBox(0,"Error","Cannot find window") Exit EndIf I compiled the script into an exe, and I'm running it like this: finde