From 9c0758ceb7f0edde3a00684dcc31c66128f42076 Mon Sep 17 00:00:00 2001 From: Simone Date: Tue, 9 Jun 2026 22:52:29 +0200 Subject: [PATCH] feat(prepare-win): set cmd.exe shell up front (before toolchain) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set Winlogon\Shell=cmd.exe and drop the live explorer at the very start of prepare-win, before the toolchain runs, so every reboot in the Windows Update 3010 loop already boots without explorer — eliminating the shell crash-loop during heavy servicing, not just at the final reboot. Still re-affirmed before the final reboot and baked into post-install. --- src/ci_orchestrator/commands/template.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ci_orchestrator/commands/template.py b/src/ci_orchestrator/commands/template.py index ea6e167..f10c43d 100644 --- a/src/ci_orchestrator/commands/template.py +++ b/src/ci_orchestrator/commands/template.py @@ -668,6 +668,19 @@ def template_prepare_win( click.echo("[prepare-win] WinRM ready.") try: + # Switch the interactive shell to cmd.exe up front, before the toolchain + # runs, so every reboot in the Windows Update 3010 loop already boots + # without explorer — no shell crash-loop during heavy servicing. Drop the + # live explorer now too (Winlogon relaunches the shell = cmd). Re-affirmed + # before the final reboot and baked into post-install for redundancy. + click.echo("[prepare-win] Setting interactive shell to cmd.exe ...") + transport.run( + "Set-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT" + "\\CurrentVersion\\Winlogon' Shell 'cmd.exe' -Type String -Force\n" + "Stop-Process -Name explorer -Force -ErrorAction SilentlyContinue\n", + check=False, + ) + # Ensure C:\CI exists transport.run( "if (-not (Test-Path 'C:\\CI')) "