' This script will add a value to the system registry.
'
' We do this by creating a .reg file and then executing "regedit
/s" as
' an external process so it will access the system registry instead
of the
' virtual registry.
Function OnFirstParentStart ' We
need to create the .reg file in a place which has IsolationMode set
to
' Merged, so we can access it easily from both the virtual
environment (this
' script) and the system environment (regedit /s). One directory
which has
' a Merged IsolationMode by default is the %Personal% directory, so
let's
' create the reg file there
RegFileName = ExpandPath("%Personal%\thin.reg")
Set fso = CreateObject("Scripting.FileSystemObject")
Set RegFile = fso.CreateTextFile(RegFileName, true)
'
Enter the info into the system registry, wait until it is
done
RegEditPid = ExecuteExternalProcess("regedit /s
" & chr(34) & RegFileName & chr(34)) WaitForProcess RegEditPid, 0
'
Clean up
fso.DeleteFile(RegFileName)
End Function