Code: Select all
OpenConsole()
RunProgram("tree")
Input()
Code: Select all
; Compiler = RunProgram("tree", "", "", #PB_Program_Open | #PB_Program_Read) ; Original line
Compiler = RunProgram("cmd.exe", "/c tree", "", #PB_Program_Open | #PB_Program_Read) ; Corrected to run cmd.exe /c tree
Output$ = ""
If Compiler
While ProgramRunning(Compiler)
If AvailableProgramOutput(Compiler)
Output$ + ReadProgramString(Compiler) + Chr(13)
EndIf
Wend
Output$ + Chr(13) + Chr(13)
Output$ + "Exitcode: " + Str(ProgramExitCode(Compiler))
CloseProgram(Compiler) ; Close the connection to the program
EndIf
MessageRequester("Output", Output$)
EDIT : To correct RunProgram() line.