4midori
4midori

Reputation: 486

Targeting active processes in Windows Power Automate actions

I have created an action to shut down several processes. Why? I am using Dragon Pro voice-to-text and Voice Computer in my adaptive technology stack. Unfortunately, the former crashes regularly, and when this happens, it doesn't shut down cleanly. I have the following action in Windows Power Automate, using this trick to listen for a shortcut key.

action

action step

I tried targeting each process by its ID, but it seems that the ID changes each time the process runs a new. So then I tried by process name, but that doesn't seem to work. How do I properly target these processes?

Upvotes: 0

Views: 678

Answers (1)

Skin
Skin

Reputation: 11262

Can I suggest using a PowerShell script? Using PAD seems like a bit of overkill to achieve such a thing but I guess if it's baked into your entire solution then this will work nicely and we all know there is an action within PAD to run a PowerShell script.

$processes = Get-Process

Foreach ($process in $processes) {
    if ( $process.Name -eq "natspeak" ) {
        Stop-Process -Name $process.Name
    }
}

Upvotes: 1

Related Questions