Friday, January 5, 2024

LogonCommand doesn't execute in windows sandbox

I was trying to use Windows Sandbox to run UniFi server and I wanted to install VC140 as a logon command which seemed to not work 🤔 I was mounting the Desktop folder where I had both the executable and the startup.cmd file. Opening the sandbox and running the script worked. This means that the LogonCommand should also work, right? 

Well, no, because the scripts needs to use full paths as mentioned in this youtube video.

In order to make the script work, I specified the full path name as follows:

The final wsb file is the following:

In this file, I mount the Ubiquiti UniFi, which is found in my host machine C:\sndboxfiles. This folder contains the extracted files after installing the UniFi server through the downloaded UniFi-installer.exe. I also mount the C:\sndboxfiles\Desktop at the sandbox's user (WDAGUtilityAccount) Desktop. In that folder, I have the VC_redist.x64.exe file which I downloaded from Microsoft and the startup.cmd which installs Visual C++ quietly. The LogonCommand simply executes the script which now works, because the final script invokes the VC_redist.x64.exe with full path name, including the folders.

No comments: