Add ‘Run in Sandbox’ to Context Menu

You will have to use a third-party tool that comes in the form of a PowerShell script. It adds Run in Sandbox option in the context menu. When you right-click on files such as PS1, VBS, EXE, MSI, ZIP, you get to launch these files directly into the Sandbox. Once installed, all you need do is right-click on the file, choose to run the file in Sandbox. You may be asked for admin permission, and that’s fine.

How to install this tool?

Download the script from Github, and extract it. Then locate the Run the file Add_Sandbox_ContextMenu.ps1. If you have PowerShell on your computer, then the script file should work. Once the script execution is complete,  it will add the option for PS1, VBS, EXE and MSI files.  It also adds another option that allows you to share a specific folder in the Sandbox.

What happens in the background?

Once you run a file in Sandbox, a WSB file will be generated. It will then create a startup command using the file path and type (exe, ps1, vbs, MSI). The folder of the file will be added as a shared folder. The VGPU and Networking options are enabled by default. You can change that on the file Sandbox_Config.xml, located in the Run_in_Sandbox folder. So next time when you want to run a supported program, all you need to is right-click on it, and you will have the option to run in the Windows Sandbox. When doing so, a Sandbox configuration file will be generated on your desktop using the file name. It will then automatically launch the Sandbox with the specific configuration.

When an exe file is made to run in Sandbox, it will offer a GUI where you can input parameters or arguments if the exe file or script needs it. You will have to choose to run it with parameters to reveal the parameters box.