CreateProcess( command$ )

Parameters

command$

Description

CreateProcess launches a 'console based' app and returns a handle to a stream representing its input/output.

If the app is expecting input, you can write to the stream to automatically enter lines of input using WriteLine.

If the app is generating output, you can read back from the stream to receive the lines using ReadLine.

*Note* This only works with console based apps that using stdin/stdout. Windows apps typically generate no output.

Blitz Print/Input are supposed to use stdin/stdout, but that feature is not quite working properly yet.

See also: ExecFile.

Example

; Thanks to Semar for this example.
; Not a great example because "calc.exe" doesn't produce any output, but...

process$ = "calc.exe"
s = CreateProcess (process)

While Not Eof(s)
If MilliSecs() - t >= 1000 Then
DebugLog "process " + process + " running"
t = MilliSecs()
EndIf
Wend

DebugLog "process " + process + " terminated"
Stop

End

Index

Click here to view the latest version of this page online