Integration

Table Of Contents
e In the Value data text box, type 1 to enable start session scripting and click OK.
You can type 0 to disable this feature. The default value is 0.
f (Optional) To delay the StartSession response by Horizon Agent, add a second DWORD value to
the Configuration key called WaitScriptsOnStartSession.
A WaitScriptsOnStartSession data value of 1 causes Horizon Agent to delay sending a
StartSession response and fail if the scripts do not complete. A value of 0 means that
Horizon Agent does not wait for the scripts to complete or check script exit codes before sending
the StartSession response. The default value is 0.
6 Set a registry value to specify timeout values in seconds rather than minutes to prevent scripts from
timing out.
Seing this timeout value in seconds enables you to congure the VMware View Script Host service
timeout value in seconds. For example, if you set the VMware View Script Host service timeout to 30
seconds, you can ensure that a start session script either nishes running or times out before a View
Connection Server timeout occurs.
a Navigate to HKLM\SOFTWARE\VMware, Inc.\VMware VDM\ScriptEvents.
b Add a DWORD value called TimeoutsInMinutes.
c Set a data value of 0.
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 le, 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
le. 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
View Integration
86 VMware, Inc.