Integration

7 (Optional) To enable the VMware View Script Host service to time out the start session script, set a
timeout value.
a Navigate to HKLM\SOFTWARE\VMware, Inc.\VMware VDM\ScriptEvents\StartSession.
b In the topic area, right-click the Default (@) key and select Modify.
c In the Value data text box, type the timeout value and click OK.
A value of 0 means that no timeout is set.
8 Exit the Registry Editor and restart the system.
Sample Start Session Scripts
These sample start session scripts illustrate how to write environment variables to a file, test the timeout
functionality, and test a non-zero exit code.
The following sample Visual Basic script writes all the environment variables provided to the script into a
file. You can use this sample script to see example data in your own environment. You might save this
script as C:\sample.vbs.
Option Explicit
Dim WshShell, FSO, outFile, strOutputFile, objUserEnv, strEnv
strOutputFile = "c:\setvars.txt"
Set FSO = CreateObject("Scripting.fileSystemObject")
Set outFile = FSO.CreateTextFile(strOutputFile, TRUE)
outFile.WriteLine("Script was called at (" & Now & ")")
Set WshShell = CreateObject( "WScript.Shell" )
Set objUserEnv = WshShell.Environment("PROCESS")
For Each strEnv In objUserEnv
outFile.WriteLine(strEnv)
Next
outFile.Close
The following sample script tests the timeout functionality.
Option Explicit
WScript.Sleep 60000
The following sample script tests a non-zero exit code.
Option Explicit
WScript.Quit 2
View Integration
VMware, Inc. 47