WMI Process Info

Hi Support Team,

I’d like to close a process by means of the Close Process action. The help says that I can grab the required ProcessID from WMI Process Info.

The help for WMI Process Info says that I need to grab the info in the After Action script event. But the only ProcessID provided by the Action is Action.ProcessParentProcessId. Action.ProcessID is a string, which contains the ProcessID entered on the Action Property Editor - which is empty because I search by name.

The debug output is as follows:

WMI Process Info
    Status: Completed
      Date: 18.09.2015
      Time: 09:52:28:070
       End: 09:52:28:183
  Duration: 00:00:00:113

Action Messages:
Process found
Process name: miae.exe
Caption: miae.exe
Description: miae.exe
HandleCount: 278
ExecutablePath: C:\Program Files (x86)\InstallAware X3\miae.exe
ThreadCount: 5
Priority: 8
WorkingSetSize: 69431296
PeakWorkingSetSize: 68684
PageFaults: 25876
PageFileUsage: 39296
ParentProcessId: 2824
PeakPageFileUsage: 43240
PeakVirtualSize: 224886784
CreationDate: 18.09.2015 09:44:01
KernelModeTime: 37500000
MaxWorkingSetSize: 1380
MinWorkingSetSize: 200
OtherOperationCount: 1825
OtherTransferCount: 53298
PrivatePageCount: 40239104
QuotaNonPagePoolUsage: 69
QuotaPagePoolUsage: 384
QuotaPeakNonPagePoolUsage: 87
QuotaPeakPagePoolUsage: 407
ReadOperationCount: 5475
ReadTransferCount: 72995793
SessionId: 2
UserModeTime: 27656250
WriteOperationCount: 109
WriteTransferCount: 935939

The current ProcessID should be stated as 1260.

Do I miss something?

Best regards
Michael

Hi Michael,

Thanks for reporting this. Turns out the process id was not being set if the process was being found by name. I have corrected the issue in both FinalBuilder 7 and 8. You can find the releases below. Please let me know if these fixes suit your needs and I will merge these updates into the main code base.

You will still need to set your variable in the after script of the WMI process info action. It will now however have a value which is set to the actual process id of the process found.


http://downloads.finalbuilder.com/downloads/finalbuilder/700/FB700_3451.exe

http://downloads.finalbuilder.com/downloads/finalbuilder/800/FB800_1141.exe

Hi Jason,

I tried the new FB 7 installer. The output from WMI still does not contain the ProcessID:

Process found
Process name: Uedit32.exe
Caption: Uedit32.exe
Description: Uedit32.exe
HandleCount: 329
ExecutablePath: C:\Program Files (x86)\UltraEdit\Uedit32.exe
ThreadCount: 14
Priority: 8
WorkingSetSize: 35229696
PeakWorkingSetSize: 34440
PageFaults: 9675
PageFileUsage: 13360
ParentProcessId: 4256
PeakPageFileUsage: 13400
PeakVirtualSize: 263393280
CreationDate: 23.09.2015 14:05:53
KernelModeTime: 3120020
MaxWorkingSetSize: 1380
MinWorkingSetSize: 200
OtherOperationCount: 3342
OtherTransferCount: 16532
PrivatePageCount: 13680640
QuotaNonPagePoolUsage: 30
QuotaPagePoolUsage: 380
QuotaPeakNonPagePoolUsage: 30
QuotaPeakPagePoolUsage: 421
ReadOperationCount: 170
ReadTransferCount: 1299230
SessionId: 1
UserModeTime: 1560010
WriteOperationCount: 3198
WriteTransferCount: 103387

But your’re right, the ProcessID from the property editor is set to the ProcessID. I can use it, but a side effect is, that the finalbuilder project is modified. If saved the ProcessID is in the fbp7 file. As this file is under version control any run will be checked in with a different ProcessID. This should be avoided.

Is there a way to have the ProcessID found by WMI in the list of information (like WorkingSetSize and others) which are not saved to fbp7 file?

Best regards
Michael

Hi Michael,

I have update the previous build I gave you with a new member on the action, ProcessFoundID. This member will never be saved to the project and will always be updated with the located process’s ID. The ProcessID will no longer be updated, and will only ever hold the value entered by the user in the action dialog.

Please note that his build is separate to the 8.0.0.1182 build I have given you. I would like to make sure that this functionality change is correct before merging into the main code base. Please let me know everything is working as you would expect and I will make another release with this change merged.

http://downloads.finalbuilder.com/d…0_1177.exe 

Hi Jason,

thank you for your answer.

Unfortunately I cannot test the new build because our license upgrade agreement is not renewed. Probably I'll check it today evening at home where I already renewed the subscription and then get back to you.

Best regards
Michael

Hi Jason,

I have tested Build 1177. Well done - it works fine. The ProcessFoundID is the correct Process ID of the process searched by name and no change is made to the project file.

Thank you for your assistance.

Best regards
Michael

I will merge this change into the release we are making today then. Thank you for reporting back so quickly.