• Welcome to Theos PowerBasic Museum 2017.

IWshExec.ProcessID Property

Started by José Roca, July 14, 2008, 10:19:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca



The following example illustrates the use of the ProcessID property.


LOCAL pWsh3 AS IWshShell3
LOCAL pWshExec AS IWshExec

pWsh3 = NEWCOM "WScript.Shell"
IF ISNOTHING(pWsh3) THEN EXIT FUNCTION
pWshExec = pWsh3.Exec(UCODE$("calc"))
PRINT "Process ID: " pWshExec.ProcessID

DO
   IF pWshExec.Status <> 0 THEN EXIT DO
   SLEEP 100
LOOP

PRINT "Status: " pWshExec.Status