Skip to main content

May 25, 2026

Add Windows Registry Entries for a Start Session Script

You must add Windows registry entries on each Horizon desktop virtual machine where you want Horizon to run a start session script.

Prerequisites

  • Verify that the path where you configured your start session scripts is accessible only to the SYSTEM account and local administrators. For more information, see Best Practices for Using Start Session Scripts.
  • Make sure your start session scripts run quickly. If you set the WaitScriptsOnStartSession value in the Windows registry, your start session script must finish running before Horizon Agent can respond to the StartSession message that the connection broker sends. For more information, see Best Practices for Using Start Session Scripts.

Procedure

  1. Log in to the Omnissa Horizon 8 desktop virtual machine.

  2. At the command prompt, type regedit to start the Windows Registry Editor.

  3. In the registry, navigate to ScriptEvents.

  4. Add the path to the start session script to the registry.

    1. In the navigation area, right-click ScriptEvents, select New > Key, and create a key named StartSession.

    2. In the navigation area, right-click StartSession, select New > String Value, and create a string value that identifies the start session script to run, for example, SampleScript.

      To run more than one start session script, create a string value entry for each script under the StartSession key. You cannot specify the order in which these scripts run. If the scripts must run in a particular order, invoke them from a single control script.

    3. In the topic area, right-click the entry for the new string value and select Modify.

    4. In the Value data text box, type the command line that invokes the start session script and click OK.

      Type the full path of the start session script and any files that it requires.

  5. Add and activate a start session value in the registry.

    1. Navigate to Agent\Configuration.

    2. If the Configuration key does not exist, right-click Agent, select New > Key, and create the key.

    3. In the navigation area, right-click Configuration, select New > DWORD (32 bit) Value, and type RunScriptsOnStartSession.

    4. In the topic area, right-click the entry for the new DWORD value and select Modify.

    5. In the Value data text box, type 1 to activate start session scripting and click OK.

      You can type 0 to deactivate this feature. The default value is 0.

    6. 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.

    Setting this timeout value in seconds allows you to configure the View Script Host service timeout value in seconds. For example, if you set the View Script Host service timeout to 30 seconds, you can ensure that a start session script either finishes running or times out before a connection broker timeout occurs.

    1. Navigate to ScriptEvents.

    2. Add a DWORD value called TimeoutsInMinutes.

    3. Set a data value of 0.

  7. To activate the View Script Host service to time out the start session script, set a timeout value.

    1. Navigate to ScriptEvents\StartSession.

    2. In the topic area, right-click the Default (@) key and select Modify.

    3. 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.

Was this page helpful?

Provide feedback for this topic

Was this topic helpful?

Please do not include any personal or confidential information.

Generating link…