Author Topic: IWshExec.ProcessID Property  (Read 3284 times)

0 Members and 1 Guest are viewing this topic.

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2517
  • User-Rate: +209/-0
  • Gender: Male
IWshExec.ProcessID Property
« on: July 14, 2008, 10:19:11 PM »

The following example illustrates the use of the ProcessID property.

Code: [Select]
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