Seite 1 von 1
Wie kann man die Windows Sandbox maximiert (Fullscreen) starten? [gelöst]
Verfasst: 13.12.2022, 18:11
von Holgi
Es geht um die Sandbox von Windows 11 (current).
Weiß jemand, ob es einen Aufruf, oder einen Trick gibt, die Sandbox maximiert zu starten, oder meinethalben auch nach dem Start zu maximieren, ohne dies händisch über den Windows maximieren Button machen zu müssen?
Aufruf erfolgt über eine *.wsb Datei.
Re: Wie kann man die Windows Sandbox maximiert (Fullscreen) starten?
Verfasst: 01.01.2023, 13:29
von Holgi
das "Problem" habe ich immer noch nicht gelöst, bin aber vlt. nahe dran (mit eurer Hilfe):
von Nirsoft gibt es dieses schöne nircmd.exe. Ein mächtiges Tool.
http://www.nirsoft.net/utils/nircmd.html
dort gibt es einen Befehl "sendkeypress"
https://nircmd.nirsoft.net/sendkeypress.html
grds. kann man die Windows Sandbox mit
in den Fullscreen zwingen.
Da es auf meinem Lenovo keine Break/Pause Taste gibt, funktioniert hier der Befehl (händisch; auf der Tastatur):
Ich gehe davon aus, dass "Break" und "Pause" identisch sind!?
In der Befehlszeile (oder einfach "ausführen") mit dem Befehl:
oder
läuft der Befehl zwar ohne Fehlermeldung durch; es passiert aber nix!
Hat jemand noch eine Idee?
Vlt. mit WshShell.SendKeys?
https://ss64.com/vb/sendkeys.html
Keine Ahnung, wie man das benutzt.
Re: Wie kann man die Windows Sandbox maximiert (Fullscreen) starten?
Verfasst: 01.01.2023, 15:30
von Holgi
hab´s hinbekommen; dank intensiver Internetrecherche!
folgende Zeilen in einen Editor kloppen und als *.vbs abspeichern.
Dann mit Doppelklick starten.
Code: Alles auswählen
set WshShell = CreateObject("WScript.Shell")
WshShell.Run "%SystemRoot%\System32\WindowsSandbox.exe"
WScript.Sleep 20000
WshShell.AppActivate "Sandbox"
WshShell.SendKeys ("^%{BREAK}")
bei der SleepTime muss man ein wenig experimentieren:
mal funzt es mit 20000 mal mit 10000.
Wer will kann auch noch eine *.cmd anlegen, die dann den selben Namen wie das VBS-Script hat.
Beide im gleichen Ordner abspeichern und dann eben die CMD ausführen:
Ist zwar alles ziemlich sinnlos, spart mir aber täglich ein paar Mausklicks

Re: Wie kann man die Windows Sandbox maximiert (Fullscreen) starten?
Verfasst: 21.01.2026, 17:11
von Holgi
hier noch eine etwas elegantere Lösung mit Powershell, um das Windows Sandbox Fenster maximiert zu starten:
folgendes PS Script startet die Sandbox ganz normal; ohne Konfiguration:
Code: Alles auswählen
$exe = Join-Path $env:windir "System32\WindowsSandbox.exe"
Start-Process $exe | Out-Null
Add-Type @"
using System;
using System.Runtime.InteropServices;
public static class Win32 {
[DllImport("user32.dll")] public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll")] public static extern bool SetForegroundWindow(IntPtr hWnd);
}
"@
$proc = $null
for ($i=0; $i -lt 600; $i++) {
$proc = Get-Process -Name "WindowsSandboxRemoteSession" -ErrorAction SilentlyContinue | Select-Object -First 1
if ($proc) { $proc.Refresh(); if ($proc.MainWindowHandle -ne 0) { break } }
Start-Sleep -Milliseconds 100
}
if (-not $proc -or $proc.MainWindowHandle -eq 0) { throw "Sandbox-Fenster nicht gefunden." }
Start-Sleep -Seconds 8
[Win32]::ShowWindow($proc.MainWindowHandle, 3) | Out-Null # SW_MAXIMIZE
[Win32]::SetForegroundWindow($proc.MainWindowHandle) | Out-Null
bei "Start-Sleep -Seconds 8" muss man etwas jonglieren. Evtl. reichen da auch schon ein paar Sekunden weniger.
möchte man die Sandbox mit einer Konfigurationsdatei (.wsb) starten, dann sieht das so aus:
Code: Alles auswählen
$wsb = "C:\Users\Public\Downloads\WSB_portable.wsb"
Start-Process -FilePath $wsb | Out-Null
Add-Type @"
using System;
using System.Runtime.InteropServices;
public static class Win32 {
[DllImport("user32.dll")] public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll")] public static extern bool SetForegroundWindow(IntPtr hWnd);
}
"@
$proc = $null
for ($i=0; $i -lt 600; $i++) {
$proc = Get-Process -Name "WindowsSandboxRemoteSession" -ErrorAction SilentlyContinue | Select-Object -First 1
if ($proc) {
$proc.Refresh()
if ($proc.MainWindowHandle -ne 0) { break }
}
Start-Sleep -Milliseconds 100
}
if (-not $proc -or $proc.MainWindowHandle -eq 0) { throw "Sandbox-Fenster nicht gefunden." }
Start-Sleep -Seconds 10
[Win32]::ShowWindow($proc.MainWindowHandle, 3) | Out-Null
[Win32]::SetForegroundWindow($proc.MainWindowHandle) | Out-Null
hier müßte der Speicherort der .wsb angepasst werden (im Beispiel: $wsb = "C:\Users\Public\Downloads\WSB_portable.wsb") und die Sekunden ggf. ebenfalls (Start-Sleep -Seconds 10).
Ein Beispiel für eine .wsb findet ihr hier:
viewtopic.php?p=453572#p453559
Diese .wsb umgeht die Smart App Control in der Sandbox
Bei Fragen: einfach fragen
