I'm writing a script that starts a process (UiPath.Executor.exe) unless it's already running:
while True:
process_names = (process_names.name() for process_names in psutil.process_iter()) # <- task mngr processes
if "UiPath.Executor.exe" not in process_names: #then run it
The problem is I'm on a server with multiple users who might be running the same process at the same time, and the process shows up in the Background processes of the Task Manager. So the script thinks it's already running.
When my version of it runs, it runs in Apps section of the task manager, not Background processes.
Is there a way to differentiate between Apps and Background processes in my script?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…