How to Use Windows Sandbox with a Custom `.wsb` File

Since the release of Windows 11 version 24H2, Microsoft quietly removed a few familiar tools from the default Windows Sandbox image — including Notepad, WordPad, and PowerShell ISE. While that might not be a big deal for the average user, it’s a frustrating change for IT pros, script jockeys, and automation nerds like me. Fortunately, there’s a solid workaround: with a custom .wsb file and some prep work, you can still launch a disposable sandbox environment and inject whatever tools you need. This guide walks you through exactly how to do that — clean, simple, and safe.

What You Need

  • Windows 11 Pro, Enterprise, or Education
  • Version 22H2 or later
  • Virtualization enabled in BIOS/UEFI
  • Administrator rights

If Windows Sandbox Isn’t Enabled Yet

Option 1: Use the GUI

  1. Press Win + R, type optionalfeatures.exe, and press Enter
  2. Check Windows Sandbox
  3. Click OK and reboot

Option 2: Use PowerShell

Run this in an elevated PowerShell window:

Enable-WindowsOptionalFeature -FeatureName "Containers-DisposableClientVM" -All -Online

Step 1: Download and Extract the ZIP

Extract Sandbox.zip (click here to download the zipfile) to:

C:\Sandbox

This archive contains:

  • Sandbox.wsb
  • Sandbox_Setup_Guide.pdf
  • Fileshare\install-software.ps1
  • Fileshare\executionpolicy.ps1
  • Fileshare\setup.cmd
  • Fileshare\additional_commands.cmd

Step 2: Understand the .wsb File

The .wsb configuration mounts the local Fileshare folder inside the Sandbox and runs the install script automatically at logon.

Example Sandbox.wsb content:

<Configuration>
  <MappedFolders>
    <MappedFolder>
      <HostFolder>C:\Sandbox\Fileshare</HostFolder>
      <ReadOnly>false</ReadOnly>
    </MappedFolder>
  </MappedFolders>
  <LogonCommand>
    <Command>powershell.exe -ExecutionPolicy Bypass -File "C:\Users\WDAGUtilityAccount\Desktop\fileshare\install-software.ps1"</Command>
  </LogonCommand>
</Configuration>

Step 3: Launch the Sandbox

  1. Double-click Sandbox.wsb
  2. Windows Sandbox starts
  3. The folder is mapped, and install-software.ps1 runs
  4. The script installs:
    • PowerShell 7.1
    • Visual Studio Code
    • Notepad++
    • VSCode extensions (optional)
  5. Logs are saved to Installing.txt and renamed to Done.txt after completion

Windows 11 24H2: Missing Default Tools

In this version of Windows 11, the following are no longer included in Sandbox:

  • PowerShell ISE
  • Notepad
  • WordPad

Solution:
Install or include replacements in your setup manually (like VSCode, Notepad++).


Step 4: Done? Just Close the Window

When you close the Sandbox, everything resets.
Your host system remains untouched.

To repeat the process, just launch the .wsb file again.


Optional: Create More Sandbox Profiles

You can clone and customize .wsb files for different tasks:

  • DevTools.wsb – Full developer suite
  • TestSetup.wsb – App or script testing
  • CleanShell.wsb – Minimal environment for debugging

Summary

  • Fast, isolated test environments
  • Perfect for script validation, install tests, or development tools
  • Fully customizable .wsb files
  • Always disposable, always clean

Leave a Reply

Your email address will not be published. Required fields are marked *