Author Topic: IWshExec.Terminate Method  (Read 2848 times)

0 Members and 1 Guest are viewing this topic.

Online José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2513
  • User-Rate: +209/-0
IWshExec.Terminate Method
« on: July 14, 2008, 08:38:03 PM »

The following code demonstrates how to use the Terminate method to stop a running script.

JScript

Code: [Select]
var aScript = WScript.Exec("%comspec% /c myScript.js");
aScript.Terminate();


PowerBASIC

Code: [Select]
DIM pWsh3 AS IWshShell3
DIM pWshExec AS IWshExec
pWsh3 = NEWCOM "WScript.Shell"
pWshExec = pWsh3.Exec(UCODE$("%comspec% /c myScript.js"))
pWshExec.Terminate