Możesz spróbować tego w AutoHotkey. Nie robi nawet podstawowych rzeczy, takich jak możliwość zmiany rozmiaru okna, ale może działać dla Ciebie. Ponadto pierwsze pole wejściowe nie jest oznaczone, ale jest to katalog roboczy, którego należy użyć. Po wpisaniu polecenia i naciśnięciu klawisza Enter, włączy się automatyczna aktualizacja po tym i automatycznie uruchomi się po każdym naciśnięciu klawisza.
;---------------------------------------------------------------------------------------------
; CommandConsole.ahk
;---------------------------------------------------------------------------------------------
Main:
myTitle := "Command Console"
myFont := "Courier New"
myFontSize := "10"
xMargin := 10, yMargin := 10
xSpace := 10, ySpace := 10
txtWidth := 700, butWidth := 100
inputHeight := 20
outputHeight := 600
firstRun := True
immediateExec := False
Gui, Add, Button, x0 y0 w0 h0 default gbutSubmit, ; default button used for grabbing text entry
vertical := yMargin
Gui, Font, % "s" myFontSize, % myFont
Gui, Add, Edit, % "x" xMargin " y" vertical " w" txtWidth " h" inputHeight " vWorkingDir", . ; current directory is default working directory, i.e., "."
Gui, Font
Gui, Add, Button, % "x" xMargin+txtWidth+xSpace " y" vertical " w" butWidth " h" 2*inputHeight+yspace " gButAuto vButCaption", % "Auto-Update`n" . (immediateExec ? "On" : "Off")
vertical += inputHeight + ySpace
Gui, Font, % "s" myFontSize, % myFont
Gui, Add, Edit, % "x" xMargin " y" vertical " w" txtWidth " h" inputHeight " gEditUpdated vtxtInput",
Gui, Font
Gui, Font, % "s" myFontSize, % myFont
vertical += inputHeight + ySpace
Gui, Add, Edit, % "x" xMargin " y" vertical " w" txtWidth+xSpace+butWidth " h" outputHeight " vtxtOutput " ; disabled"
Gui, Font
vertical += OutputHeight+yMargin
Gui, Show, % "w" txtWidth+xSpace+butWidth+2*xMargin " h" vertical, % myTitle
GuiControl, focus, txtInput ; focus on the command input for entry
return
;---------------------------------------------------------------------------------------------
; GuiClose() - Exit app when GUI closes
;---------------------------------------------------------------------------------------------
GuiClose() {
ExitApp
}
;---------------------------------------------------------------------------------------------
; butSubmit() - No-size button to capture Enter keystrokes when auto-update is off
;---------------------------------------------------------------------------------------------
butSubmit() {
global
EnterWasPressed := True
if firstRun and !immediateExec ; set auto-update after the first command is executed if it's not set already
ButAuto()
else
EditUpdated() ; on subsequent
}
;---------------------------------------------------------------------------------------------
; EditUpdated()
;---------------------------------------------------------------------------------------------
EditUpdated() {
global ; easy access to GUI vars
Gui, Submit, NoHide
;tooltip Edit was updated: %txtInput%
if immediateExec or EnterWasPressed {
guiControl,, txtOutput, % RunWaitOneB(txtInput, WorkingDir)
EnterWasPressed := False
}
lasttxtInput := txtInput
Gui, Submit, NoHide
if (txtInput<>lastTxtInput)
setTimer, EditUpdated, -1
return
}
;---------------------------------------------------------------------------------------------
; ButGo() - Called every time the user clicks auto-execute True/False Button
;---------------------------------------------------------------------------------------------
ButAuto() {
global
immediateExec := !immediateExec
guiControl,, butCaption, % "Auto-Update`n" . (immediateExec ? "On" : "Off")
if immediateExec
EditUpdated()
}
;---------------------------------------------------------------------------------------------
; RunWaitOne() - From AutoHotkey Help for RunWait (has annoying command prompt flash up)
;---------------------------------------------------------------------------------------------
RunWaitOne(command) {
shell := ComObjCreate("WScript.Shell") ; WshShell object: http://msdn.microsoft.com/en-us/library/aew9yb99
exec := shell.Exec(ComSpec " /C " command) ; Execute a single command via cmd.exe
return exec.StdOut.ReadAll() ; Read and return the command's output
}
;---------------------------------------------------------------------------------------------
; RunWaitOneB() - Get stdout by writing to a temp file vs. reading the buffer
;---------------------------------------------------------------------------------------------
RunWaitOneB(command, WorkingDir:=".") {
tmpFile := A_Temp . "\temp.txt"
FileDelete, %tmpFile%
RunWait, %comspec% /c %command% > %tmpFile%, %WorkingDir%, Hide
FileRead, output, %tmpFile%
return output
}