Dim isRunning As Boolean = False
Dim searcher As ManagementObjectSearcher = New ManagementObjectSearcher(“SELECT * FROM Win32_Process WHERE Name=‘java.exe’ OR Name=‘javaw.exe’”)
For Each process As ManagementObject In searcher.Get()
Dim cmdlparam As String = process(“CommandLine”)
If cmdlparam.ToLower.Contains(“function.exe”) Or cmdlparam.ToLower.Contains(“service.jar”) Then
isRunning = True
End If
Next
To run this I need to import Microsoft “System.Management” package.
But after installing the package (V4.5.0) UIPath shows error “package installation failure”.
The Activity “Get Processes” does not help, as I can not get the commandline parameters of the running processes.
Just adding the right namespace “System.Management.Instrumentation” leads to an automatically adding of Assembly Reference “System.Management”.
And the code is working correctly