9.8.2 GetProcessInfo (get process information)
- Purpose
-
Gets process information for a specified process ID.
- Syntax
GetProcessInfo(ProcessId, [StartTimeBuff] [, ProcessorTimeBuff])
- Arguments
-
- ProcessId
-
Specify the process ID as a number or as a variable that stores this value.
This process ID is the value returned in the buffer argument of the GetProcessCount command.
In JP1/Script 06-00 and later versions, you can specify the _EXEC_ID_ reserved variable set at execution of the Exec or NetExec command. In this case, the GetProcessInfo command acquires process information for an executable file called by an Exec or NetExec command specified not to wait for completion of the executable file (Flag argument set to False).
- StartTimeBuff
-
Specify a variable for storing the process start time. The time is returned in hh:mm:ss format. Omit this argument if not required.
- ProcessorTimeBuff
-
Specify a variable for storing the process operation time (seconds). Omit this argument if not required.
- Description
-
The GetProcessInfo command gets process information for a specified process ID, and stores the information in the specified variables. The command returns True on successful execution, or False if an error occurs.
- Note
-
Execute the script file as a user who has administrator permissions. For details, see 1.8.3 Effect of the executing user on command behavior.
- Example
' Get information about active process "ABC". Dim pCnt, pIdBuff, seppId, infBuff1, infBuff2 pCnt = GetProcessCount("ABC", pIdBuff) For i = 1 To pCnt seppId = SeparateStr(pIdBuff, ";", i) GetProcessInfo(seppId, infBuff1, infBuff2) : : Next
- JP1/Script version
-
Supported from JP1/Script 05-20.