Windows Sandbox: close without confirmation
Stops the sandbox with "wsb stop" when its window is closed
Author: loliri
Closing a Windows Sandbox window normally asks for confirmation before the sandbox is shut down. This mod replaces the close button with a clean wsb stop, so the window goes away without the prompt.
Requirements
This mod targets the new Windows Sandbox, whose remote session process is WindowsSandboxRemoteSession.exe. That process is also what the mod's include scope matches: if it does not exist on the system, the sandbox is the older version and the mod has nothing to attach to. The wsb command line tool must also be available.
Notes
The sandbox id is read from the process command line. If it cannot be found, the mod does nothing and the usual confirmation is shown.