How to have Windows Sandbox in Dark mode ? it is greyed out


Christophe

Member
Local time
1:25 PM
Posts
42
OS
Windows 11 Pro (22H2)
Hi, I need to test the dark mode of some applications with Windows dark/light mode system.
But when I want to enable Dark mode in Windows Sandbox I have this:
1680778826716.png
The dark mode / light mode dropdown list in greyed out 😥
and it saying that this requires activation. Is there an alternative way to have the dark mode in Windows Sandbox?
 

My Computer My Computer

At a glance

Windows 11 Pro (22H2)11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz32 GB
OS
Windows 11 Pro (22H2)
Computer type
Laptop
Manufacturer/Model
Dell
CPU
11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
Memory
32 GB
I think it may be possible to do so, by using a custom configuration file as per the following tutorial - Sections 1.1 to 1.5. In particular, adding a batch file within the LogonCommand tag in that configuration file to make the necessary registry change.

 

My Computer My Computer

At a glance

Win 11 25H2intel i7-870032GbIntel iGPU
OS
Win 11 25H2
Computer type
PC/Desktop
Manufacturer/Model
custom
CPU
intel i7-8700
Motherboard
Asus Z370 TUF Gaming
Memory
32Gb
Graphics Card(s)
Intel iGPU
Sound Card
Realtek
Hard Drives
Samsung
PSU
Corsair
Cooling
Fans
If you don't want to go the custom Sandbox configuration route, alternatively, open a Command prompt as Admin inside your Sandbox and then make the Registry change for disabling the Light theme using the comand shown in the above mentioned tutorial.

So, inside the Sandbox, open a Command box (as Admin) and enter the following commands one after the other (ie. basically make a Registry change, terminate and restart Explorer.exe for the dark mode to take effect.

Code:
reg add HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v AppsUseLightTheme /t REG_DWORD /d 00000000 /f

taskkill /im explorer.exe /f

start explorer.exe
 

My Computer My Computer

At a glance

Win 11 25H2intel i7-870032GbIntel iGPU
OS
Win 11 25H2
Computer type
PC/Desktop
Manufacturer/Model
custom
CPU
intel i7-8700
Motherboard
Asus Z370 TUF Gaming
Memory
32Gb
Graphics Card(s)
Intel iGPU
Sound Card
Realtek
Hard Drives
Samsung
PSU
Corsair
Cooling
Fans
I think it may be possible to do so, by using a custom configuration file as per the following tutorial - Sections 1.1 to 1.5. In particular, adding a batch file within the LogonCommand tag in that configuration file to make the necessary registry change.

I have done and it works, thank you. For reference if someone one to do the same:
  • Here is my .bat:
Powershell:
REM Apply a custom theme
REM As Windows Sandbox is not activated, this is the only way to personalize it
C:\Users\WDAGUtilityAccount\Desktop\Sandbox\DarkMode.deskthemepack


REM Install new Microsoft Edge
REM start /wait C:\Users\WDAGUtilityAccount\Desktop\Sandbox\MicrosoftEdgeEnterpriseX64.msi /quiet /norestart


REM Switch to Dark Mode
reg add HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v AppsUseLightTheme /t REG_DWORD /d 00000000 /f


REM Close Settings app left open when theme was applied
start /wait taskkill /F /IM SystemSettings.exe

  • and here is my .wbs file;
XML:
<Configuration>
<vGPU>Enable</vGPU>
<Networking>Default</Networking>
<MappedFolders>
   <MappedFolder>
     <HostFolder>C:\Users\ENTERUSER\Sandbox</HostFolder>
     <ReadOnly>true</ReadOnly>
   </MappedFolder>
   <MappedFolder>
     <HostFolder>C:\Users\ENTERUSER\Downloads</HostFolder>
     <ReadOnly>true</ReadOnly>
   </MappedFolder>
</MappedFolders>
<LogonCommand>
   <Command>C:\users\WDAGUtilityAccount\Desktop\Sandbox\Sandbox-DarkMode.bat</Command>
</LogonCommand>
</Configuration>
 

My Computer My Computer

At a glance

Windows 11 Pro (22H2)11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz32 GB
OS
Windows 11 Pro (22H2)
Computer type
Laptop
Manufacturer/Model
Dell
CPU
11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
Memory
32 GB
If you don't want to go the custom Sandbox configuration route, alternatively, open a Command prompt as Admin inside your Sandbox and then make the Registry change for disabling the Light theme using the comand shown in the above mentioned tutorial.

So, inside the Sandbox, open a Command box (as Admin) and enter the following commands one after the other (ie. basically make a Registry change, terminate and restart Explorer.exe for the dark mode to take effect.

Code:
reg add HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v AppsUseLightTheme /t REG_DWORD /d 00000000 /f

taskkill /im explorer.exe /f

start explorer.exe
I have tried it as well in a black Sandbox, but the Sandbox is still in light mode after these commands (though there is no error when executing though commands)
 

My Computer My Computer

At a glance

Windows 11 Pro (22H2)11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz32 GB
OS
Windows 11 Pro (22H2)
Computer type
Laptop
Manufacturer/Model
Dell
CPU
11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
Memory
32 GB
Thank-you, for pointing out that the Commands by themselves don't work when run after the Sandbox has fully started. (I had presumed they would work, as I am currently not using the Sandbox feature).
 

My Computer My Computer

At a glance

Win 11 25H2intel i7-870032GbIntel iGPU
OS
Win 11 25H2
Computer type
PC/Desktop
Manufacturer/Model
custom
CPU
intel i7-8700
Motherboard
Asus Z370 TUF Gaming
Memory
32Gb
Graphics Card(s)
Intel iGPU
Sound Card
Realtek
Hard Drives
Samsung
PSU
Corsair
Cooling
Fans
Oops my mistake: in my previous post I wanted to say: I have tried it as well in a blank Sandbox (not a black).
So when none of the script in post #4 are used, using the command line did not turn the Sandbox to dark mode.
 

My Computer My Computer

At a glance

Windows 11 Pro (22H2)11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz32 GB
OS
Windows 11 Pro (22H2)
Computer type
Laptop
Manufacturer/Model
Dell
CPU
11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
Memory
32 GB
Thank-you for the further clarification (although I had presumed as much).
 

My Computer My Computer

At a glance

Win 11 25H2intel i7-870032GbIntel iGPU
OS
Win 11 25H2
Computer type
PC/Desktop
Manufacturer/Model
custom
CPU
intel i7-8700
Motherboard
Asus Z370 TUF Gaming
Memory
32Gb
Graphics Card(s)
Intel iGPU
Sound Card
Realtek
Hard Drives
Samsung
PSU
Corsair
Cooling
Fans
This is how I personally do it using PowerShell: Set Windows 11 to use Dark Mode. Particularly useful as part of a logon script for Windows Sandbox.

You can add it as part of an existing logon command or use it on it's own.

Example WSB file:

Code:
<Configuration>
  <MappedFolders>
    <MappedFolder>
      <HostFolder>C:\Data\Scripts</HostFolder>
      <SandboxFolder>C:\Data\Scripts</SandboxFolder>
      <ReadOnly>True</ReadOnly>
    </MappedFolder>
  <LogonCommand>
    <Command>powershell.exe -ExecutionPolicy Bypass -File "C:\Data\Scripts\VMs\WindowsSandbox-Wrapper.ps1"</Command>
  </LogonCommand>
</Configuration>
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
Computer type
PC/Desktop
If you don't want to go the custom Sandbox configuration route, alternatively, open a Command prompt as Admin inside your Sandbox and then make the Registry change for disabling the Light theme using the comand shown in the above mentioned tutorial.

So, inside the Sandbox, open a Command box (as Admin) and enter the following commands one after the other (ie. basically make a Registry change, terminate and restart Explorer.exe for the dark mode to take effect.

Code:
reg add HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize /v AppsUseLightTheme /t REG_DWORD /d 00000000 /f

taskkill /im explorer.exe /f

start explorer.exe

Thanks. Just what I was looking for. Do you know if there's a command prompt for changing the default wallpaper to a solid color?
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11

Latest Support Threads

Back
Top Bottom