damienvanrobaeys / Run-in-Sandbox

Run PS1, VBS, CMD, EXE, MSI, Intunewin, MSIX, or extract ISO, ZIP in Windows Sandbox very quickly just from a right-click
https://www.systanddeploy.com/2023/06/runinsandbox-quick-way-to-runextract.html
698 stars 82 forks source link

Suggestion: Add an option to run PS1 as system with params #43

Open obuolinis opened 12 months ago

obuolinis commented 12 months ago

Since you already have Run as system and Run with params, why not go and combine them? It would be useful for those who deploy their powershell scripts with Intune or SCCM, where scripts run in System context.

For this feature the code would be the same as for PS1Params, only the final command line would be different:

$PsExec = "$Sandbox_Root_Path\psexec.exe"
$ServiceUI = "$Sandbox_Root_Path\ServiceUI.exe"
$Script:Startup_Command = "$PsExec \\localhost -accepteula -s $ServiceUI -session:1 $PSRun_File $Full_Startup_Path $Paramaters"

Here:

Joly0 commented 12 months ago

You are right, that might be useful. I will look into it. Thank you