Code: Select all
OpenConsole()
Delay(500)
; RunProgram("c:\test.bat") (works)
ShellExecute_(0, "open", "c:\test.bat", "", "", #SW_NORMAL)
Delay(500)Code: Select all
@echo Hello from %0
@pause
Code: Select all
OpenConsole()
Delay(500)
; RunProgram("c:\test.bat") (works)
ShellExecute_(0, "open", "c:\test.bat", "", "", #SW_NORMAL)
Delay(500)Code: Select all
@echo Hello from %0
@pause
Code: Select all
RunProgram(FileName$, Parameter$, WorkingDirectory$, #PB_Program_Hide )He would like it to redirect the input. And he don't want to use runprogram [which does redirect the input if you are compiling using /console option]Kale wrote:http://www.purearea.net/pb/english/manu ... ogram.html
Code: Select all
RunProgram(FileName$, Parameter$, WorkingDirectory$, #PB_Program_Hide )
The RunProgram() in the code in the first post works, but I want to figure out how to do it using API. I'd like the output from the bat file inside my console window, not hidden.Kale wrote:http://www.purearea.net/pb/english/manu ... ogram.html
Code: Select all
RunProgram(FileName$, Parameter$, WorkingDirectory$, #PB_Program_Hide )

Code: Select all
OpenConsole()
GetStartupInfo_(@si.STARTUPINFO)
pi.PROCESS_INFORMATION
CreateProcess_("c:\test.bat", "", 0, 0, 1, 0, 0, 0, @si, @pi)
WaitForSingleObject_(pi\hProcess, 10000)