0

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?

Skin
  • 9,085
  • 2
  • 13
  • 29
4midori
  • 468
  • 5
  • 15

1 Answers1

1

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
    }
}
Skin
  • 9,085
  • 2
  • 13
  • 29
  • Thanks, this is a great idea. May I ask, if I target three processes, and some of them are not running, will this still function properly? And also, will it run without popping up a confirmation window? ("Do you want this app to be able to make changes on your device?") – 4midori Feb 15 '22 at 18:10
  • Yeah, it's only ever looking for the processes you want to stop so it won't break anything and as for that message, that's not PAD specific, maybe this will help ... https://windowsreport.com/do-you-want-to-allow-this-app-to-make-changes-to-your-device/ – Skin Feb 15 '22 at 21:21