I'm having an occasional issue with Windows shutting down when using the Utility.shutdownPC(); command from an ARC script.
Background and setup:
- I have a looping JavaScript script in ARC that watches a button on my robot. The button is read by an EZ-B v4 ADC port and triggers the script when the voltage changes.
- The PC running ARC (Windows 11) is mounted on the robot and connected to three EZ-B v4 controllers via USB-to-Serial converter cables (EZ-Bs are connected to the PC via USB).
- The script sends ControlCommand calls to various Robot Skills (Soundboard v4, Bender, Head Section, Left Arm, Right Arm, etc.) and then calls Utility.shutdownPC(); to shut down the onboard Windows 11 PC.
Problem: This process has worked reliably for a long time, but within the past week or so I’ve started seeing intermittent failures. When the shutdown hangs, Windows shows a message saying something like "ARC is still running and keeping the PC from shutting down" and offers a button to end ARC. If I choose that option, ARC appears to terminate and Windows then completes the shutdown.
Notes on troubleshooting I’ve tried or considered:
- I do not allow Windows Update to update my Windows 11 OS, so I don’t think a Windows update is the cause.
- I checked ARC’s settings and enabled "Do not display exit confirmation when exiting," but the same occasional hang still happens. I seem to recall that in the past I had that setting disabled and Utility.shutdownPC(); still shut down Windows without my intervention.
- I’ve read suggestions online (e.g., adding switches like /s /f /t 0 to the shutdown command and disabling Fast Startup). Fast Startup is currently enabled on my PC. I haven’t tried these Windows-level changes yet.
Here is the shutdown script I’m using (triggered by the EZ-B ADC port):
ControlCommand("Personality Generator", "PauseOn");
sleep(250);
ControlCommand("Head Section", "ScriptStart", "Bubble Full Up");
ControlCommand("Head Section", "ScriptStart", "Radar 1/4 Sweep");
var Goodbye = Utility.getRandomUnique(1, 12);
print("Goodbuy: " + Goodbye)
if (Goodbye == 1) {
ControlCommand("Soundboard v4", "Track_9");//say "Hasta La Vista"
sleep(2500);
}
else if (Goodbye == 2) {
ControlCommand("Soundboard v4", "Track_10");//say "Love Long & Prosper"
sleep(2750);
}
else if (Goodbye == 3) {
ControlCommand("Soundboard v4", "Track_36");//say "So it Goes"
sleep(2500);
}
else if (Goodbye == 4) {
ControlCommand("Soundboard v4", "Track_83");//say "Pleasure to Serve"
sleep(3500);
}
else if (Goodbye == 5) {
ControlCommand("Soundboard v4", "Track_84");//say "Goodby"
sleep(1750);
}
else if (Goodbye == 6) {
ControlCommand("Soundboard v4", "Track_91");//say "May the Force be with you"
sleep(2750);
}
else if (Goodbye == 7) {
ControlCommand("Soundboard 2", "Track_19");//say "My Power Pack needs charging"
sleep(4500);
}
else if (Goodbye == 8) {
ControlCommand("Bender", "Track_28");//Say "Shows Over"
sleep(3000);
}
else if (Goodbye == 9) {
ControlCommand("Bender", "Track_36");//Say "Wanna Kill All Humans?"
sleep(3500);
}
else if (Goodbye == 10) {
ControlCommand("Bender", "Track_30");//Say "So Long Coffin Stuffers"
sleep(3500);
}
else if (Goodbye == 11) {
ControlCommand("Bender", "Track_3");//Say "Bite My Shiny Ass"
sleep(3500);
}
ControlCommand("Head Section", "ScriptStart", "Bubble Full Down");
ControlCommand("Left Arm", "ScriptStart", "Left Claw Closed");
ControlCommand("Right Arm", "ScriptStart", "Right Claw Closed");
sleep( 1000 );
Utility.shutdownPC();
I’m totally open to suggestions or an updated script to resolve this intermittent shutdown issue where it appears ARC is preventing Windows from shutting down. Thanks!
Related Hardware (view all EZB hardware)
Related Robot Skills (view all robot skills)

That’s windows for ya who knows what updates do shrug
I can say that any looping scripts need to be stopped. If scripts are reading or writing to peripherals, that’s hardware messaging and windows controls that. So send stop commands to all your scripts from the shutdown script.
I think there’s an option in preferences to disable close dialog. Want to disable that too.
What you’re seeing is consistent with Windows waiting for ARC to fully exit, and the most common cause is exactly what DJ mentioned: one or more scripts are still running when
Utility.shutdownPC()is called.Because your shutdown script is triggered from a looping watcher script, the watcher itself may still be active long enough to keep ARC "busy" during shutdown. If any other scripts are also running, Windows can decide ARC is still preventing the shutdown.
What to change
1) Stop any looping scripts first
Before calling
Utility.shutdownPC();, explicitly stop the scripts that may still be running.If your watchdog script is separate from the shutdown script, use
ControlCommand(..., "Stop")on it and any other loops or timers.Example pattern:
2) Avoid calling shutdown from inside the looping monitor itself
If possible, have the watcher script set a flag and let a separate one-shot shutdown script handle the actual shutdown.
For example:
"$shutdownRequested" = trueThat reduces the chance the monitoring loop is still active when Windows begins closing ARC.
3) Add a small delay after stopping scripts
A short pause helps ARC finish any pending hardware commands before Windows starts shutdown.
4) Check the ARC exit confirmation setting
You already found the relevant setting:
or, if the wording is the inverse in your version, make sure ARC is allowed to close without prompting.
If Windows is still asking whether to end ARC, that means ARC didn’t exit cleanly enough before shutdown.
5) Consider Windows Fast Startup
Fast Startup can sometimes make shutdown behavior odd, especially on systems that are doing hardware/USB control like ARC. Disabling it is worth testing if this only started recently.
Suggested shutdown script structure
Here’s a cleaner version of your shutdown flow:
Best practice recommendation
For reliability, I’d strongly recommend:
That pattern is much more stable in ARC.
A couple questions so I can narrow this down
Utility.shutdownPC();, or does it start a second script?ControlCommand(..., "ScriptStart", ...)calls launching scripts that loop or wait on sensors/audio?If you want, I can help you rewrite this into a more robust two-script ARC pattern using JavaScript so the shutdown is much less likely to hang.
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
From top menu -> Options -> Preferences -> Do not display exit confirmation (make sure that's checked)
@DJ and @Athena , thanks for the help. I appreciate your personal care and taking the time to answer with your welcomed suggestions.
Actually in my first post I did mention I had already checked the "Do not display exit confirmation" in ARC's Option/Preferences section with no results.
I'll move forward with your suggestion of making sure all my looping scripts are shut down before I send the shutdown PC command. I do have a few of them so that makes sense.
I'll let you know how it works. Thanks again!
Oh, BTW, I am using a two script method. I actually do have just one script that loops and watched several (maybe 12 or so) buttons and switches. I had @Athena help me write it a few months ago. So I only have one script that keeps track of the ADC values of these dozen switches and buttons. Adding a
StopScriptcommand to the shutdown PC script for that one looping script will be quick and easy. I'll keep you posted.That sounds like the right approach.
Since you only have one looping watcher script, adding a
ScriptStopfor that script right beforeUtility.shutdownPC();is the cleanest fix. That should prevent ARC from still being "busy" when Windows starts the shutdown sequence.A good pattern would be:
A couple of important notes
"Your Watcher Script Name"with the actual name of the looping Script control.ScriptStop- for examplesleep(1000);or evensleep(1500);before the shutdown.Why this helps
Your loop is constantly reading ADC values, which means ARC is actively talking to hardware. If Windows begins shutdown while that loop is still running, it may wait for ARC to finish or decide ARC is still preventing exit. Stopping the watcher script first gives ARC a chance to become idle before the OS closes it.
If you want, I can help you rewrite your shutdown script so it:
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
I took a look at the utility shutdown command. Two global status variables within the ARC specify if the ARC is shutting down. I made a few changes on a test version to see if that will help. i can test it later when i have time to let my PC reboot. I'll let you know.
Wow @DJ, thanks! You da man!