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


Christophe

Member
Local time
6:53 AM
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

System One

  • 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

System One

  • OS
    Windows 11 23H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    custom
    CPU
    intel i7-8700 (non-K)
    Motherboard
    Asus Z370 TUF Gaming
    Memory
    32Gb
    Graphics Card(s)
    On-board Intel iGPU
    Sound Card
    On-board Realtek
    Hard Drives
    Samsung_SSD_850_EVO
    PSU
    Corsair Rm850X
    Cooling
    All air
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

System One

  • OS
    Windows 11 23H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    custom
    CPU
    intel i7-8700 (non-K)
    Motherboard
    Asus Z370 TUF Gaming
    Memory
    32Gb
    Graphics Card(s)
    On-board Intel iGPU
    Sound Card
    On-board Realtek
    Hard Drives
    Samsung_SSD_850_EVO
    PSU
    Corsair Rm850X
    Cooling
    All air
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

System One

  • 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

System One

  • 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

System One

  • OS
    Windows 11 23H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    custom
    CPU
    intel i7-8700 (non-K)
    Motherboard
    Asus Z370 TUF Gaming
    Memory
    32Gb
    Graphics Card(s)
    On-board Intel iGPU
    Sound Card
    On-board Realtek
    Hard Drives
    Samsung_SSD_850_EVO
    PSU
    Corsair Rm850X
    Cooling
    All air
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

System One

  • 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

System One

  • OS
    Windows 11 23H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    custom
    CPU
    intel i7-8700 (non-K)
    Motherboard
    Asus Z370 TUF Gaming
    Memory
    32Gb
    Graphics Card(s)
    On-board Intel iGPU
    Sound Card
    On-board Realtek
    Hard Drives
    Samsung_SSD_850_EVO
    PSU
    Corsair Rm850X
    Cooling
    All air

Latest Support Threads

Back
Top Bottom