When testing a script inside a flow, is there a way to force stop the script/flow? I have tried to stop the flow, but the element with the script is still stuck in the processing state so the flow won't stop. It will eventually timeout but it takes 15 minutes or so.
The message says "Some jobs are being process in the flow and the flow will be stopped as soon as they complete.
Force Stop Script
Re: Force Stop Script
I'd open the Progress pane in the Switch Designer, find the script that is stuck executing in the Progress pane, copy the Process ID and kill it in Resource Monitor (If you're on Windows, unsure on the Mac alternative) which will then let the flow stop


- tdeschampsBluewest
- Member
- Posts: 127
- Joined: Tue Jun 01, 2021 11:57 am
Re: Force Stop Script
If you are lazy to search the ID in the ressource monitor, create a .bat with this ::
Run it in administrator mode, then type the PID to kill it.
Code: Select all
@echo off
:Ask
echo processus to kill ? (number)
set INPUT=
set /p INPUT=%=%
TASKKILL /f /im %INPUT%
goto :Ask
Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
Feel free to leave a comment on the Appstore!
- JimmyHartington
- Advanced member
- Posts: 453
- Joined: Tue Mar 22, 2011 7:38 am
Re: Force Stop Script
Nice .bat file.
I will use this on my server.
I will use this on my server.
- tdeschampsBluewest
- Member
- Posts: 127
- Joined: Tue Jun 01, 2021 11:57 am
Re: Force Stop Script
Since we are on batFile, you can also use the following one.
Keep in mind this one can be pretty nasty
, and should be use in last resort at your own risk




Code: Select all
@echo off
:Ask
echo Are you sure to kill Switch?(y/n)
set INPUT=
set /P INPUT=Type input: %=%
If /I "%INPUT%"=="y" goto TaskKill
If /I "%INPUT%"=="n" goto Exit
:TaskKill
TASKKILL /f /im SwitchWatchdog.exe
TASKKILL /f /im Switch.exe
TASKKILL /f /im Switch_Service.exe
TASKKILL /f /im Switch_Helper.exe
TASKKILL /f /im SwitchScriptExecutor.exe
TASKKILL /f /im EnfocusSubscriptionNotifier.exe
timeout 2 >nul
goto Ask
:Exit
timeout 1 >nul
exitw
Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
Feel free to leave a comment on the Appstore!
Re: Force Stop Script
Have you tried the Switch preferences/Error handling/Abort processes after (minutes) and set it to just 1 minute. Then it should quit gracefully and just stop the problem flow.
You can change this while testing and then put it back to normal when you're done?
You can change this while testing and then put it back to normal when you're done?