Code: Select all
^!+T::Send Hello
How can I make send give input to Windows cmd terminal?
Code: Select all
^!+T::Send Hello
Code: Select all
MsgBox % RunWaitMany("
(
echo Put your commands here,
echo each one will be run,
echo and you'll get the output.
)")
RunWaitMany(commands) {
shell := ComObjCreate("WScript.Shell")
; Open cmd.exe with echoing of commands disabled
exec := shell.Exec(ComSpec " /Q /K echo off")
; Send the commands to execute, separated by newline
exec.StdIn.WriteLine(commands "`nexit") ; Always exit at the end!
; Read and return the output of all commands
return exec.StdOut.ReadAll()
}
Code: Select all
#warn
setworkingdir,%a_scriptdir%
SetBatchLines, -1
e4x=
(Ltrim join&
@echo off
echo date=
date /t
echo time=
time /t
cd\
dir
)
title2=DOS_TEST
run, %comspec% /T:0A /k "title %title2%&mode con lines=4000 cols=120&%e4x%,,,pid2
WinWait, ahk_pid %pid2%
sleep,2000
controlsend,,ver`n,ahk_pid %pid2%
return
I use Windows 10 also, fully updated.YMP2 wrote:It works on Windows 10. What version of Windows do you use?
Users browsing this forum: Bing [Bot], Google [Bot] and 267 guests