Terminates a single process on a terminal server system.
wtsTerminateProcess(server,process,exit-code)
(s) server: This is the name of the terminal server system on which a process will be terminated. The server name should have the leading "\\" characters on it. Passing in an empty string for this parameter will cause the local terminal server system to be used.
(i) process: This is a process id number that identifies the process that is to be terminated.
(i) exit-code: This is the exit code that the terminated process will be forced to use. Any programs that are waiting for the specified process to terminate will receive this exit code value when the process has terminated.
(i) Returns @TRUE on sucess or @FALSE on failure.
This function will terminate the specified process on the specified terminal server system.
;Load 32-bit or 64-bit extender AddExtender( "WWWTS44I.DLL" , 0, "WWWTS64I.DLL" )
Title01 = 'Test wtsTerminateProcess()' ServerSpec = AskLine('Terminate a process','Server','') ProcId = AskLine('Terminate a process','Process Id #','') ExitCode = AskLine('Terminate a process','Exit code','0') ErrorMode(@OFF) Result = wtsTerminateProcess(ServerSpec,ProcId,ExitCode) RC = LastError() ErrorMode(@CANCEL) TempMsg = StrCat('wtsTerminateProcess("',ServerSpec,'",',ProcId,',',ExitCode,') RC = ',RC,@CRLF) TempMsg = StrCat(TempMsg,@CRLF,@CRLF,'Result = ',Result) Message(Title01,TempMsg) Exit