Launching an app or command when Validation OS starts

You can can configure Validation OS to automatically run commands each time it boots.

Create and configure the startup script

Use the scripts below as to configure applications and commands that will run when Validation OS boots. To use the scripts, put the commands after the line that says REM ADD COMMANDS AFTER THIS LINE. Once you've added the commands to run at boot, run the script to mount your image and configure the startup process.

dism /Mount-wim /wimfile:C:\[WIMFILELOCATION]\WinVOS.wim /index:1 /mountdir:C:\OFFLINE 
New-Item "C:\OFFLINE\windows\System32\startnet.valos.cmd" -Force -ItemType File -Value "@ECHO OFF
reg query `"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon`" /v VOSStartupSetup > nul 2> nul
SET StartupSetup=%ERRORLEVEL%
IF %StartupSetup%==1 (
    ::Add commands that will run once in the lifetime of the OS after this line
    [INSERT COMMANDS OR REMOVE THIS]
    ::Don't change the next line
    reg add `"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon`" /v VOSStartupSetup /t REG_DWORD /F /D 1 > nul
)
IF NOT DEFINED StartupRun (
    ::Add commands that will run once after booting the OS after this line
    [INSERT COMMANDS OR REMOVE THIS]
    ::Don't change the next line
    SET StartupRun=1
)"
reg load HKLM\Image_SOFTWARE C:\OFFLINE\windows\system32\config\software
reg add "HKLM\Image_SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /F /D "cmd /k c:\windows\System32\startnet.valos.cmd"
reg unload HKLM\Image_SOFTWARE
dism /Unmount-Image /MountDir:C:\OFFLINE /commit
dism /Mount-wim /wimfile:C:\[WIMFILELOCATION]\WinVOS.wim /index:1 /mountdir:C:\temp\script
ECHO @ECHO OFF> C:\temp\script\windows\System32\startnet.valos.cmd
ECHO reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v VOSStartupSetup ^> nul 2^> nul>> C:\temp\script\windows\System32\startnet.valos.cmd
ECHO SET StartupSetup=^%ERRORLEVEL^%>> C:\OFFLINE\windows\System32\startnet.valos.cmd
ECHO IF ^%StartupSetup^%==1 (>> C:\OFFLINE\windows\System32\startnet.valos.cmd
ECHO     ::Add commands that will run once in the lifetime of the OS after this line>> C:\OFFLINE\windows\System32\startnet.valos.cmd
ECHO     echo HAPPENING ONCE PER LIFETIME>> C:\OFFLINE\windows\System32\startnet.valos.cmd
ECHO     ::Don't change the next line>> C:\OFFLINE\windows\System32\startnet.valos.cmd
ECHO     reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v VOSStartupSetup /t REG_DWORD /F /D 1 ^> nul>> C:\OFFLINE\windows\System32\startnet.valos.cmd
ECHO )>> C:\OFFLINE\windows\System32\startnet.valos.cmd
ECHO IF NOT DEFINED StartupRun (>> C:\OFFLINE\windows\System32\startnet.valos.cmd
ECHO     ::Add commands that will run once after booting the OS after this line>> C:\OFFLINE\windows\System32\startnet.valos.cmd
ECHO     echo HAPPENING ONCE AFTER BOOT>> C:\OFFLINE\windows\System32\startnet.valos.cmd
ECHO     ::Don't change the next line>> C:\OFFLINE\windows\System32\startnet.valos.cmd
ECHO     SET StartupRun=1 >> C:\OFFLINE\windows\System32\startnet.valos.cmd
ECHO )>> C:\OFFLINE\windows\System32\startnet.valos.cmd
reg load HKLM\Image_SOFTWARE C:\OFFLINE\windows\system32\config\software
reg add "HKLM\Image_SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /F /D "cmd /k c:\windows\System32\startnet.valos.cmd"
reg unload HKLM\Image_SOFTWARE
dism /Unmount-Image /MountDir:C:\OFFLINE /commit