Skip to main content

9 aprile 2026

Running Commands on Horizon Desktops

You can use the Horizon Agent CommandsToRunOnConnect, CommandsToRunOnReconnect, and CommandsToRunOnDisconnect group policy settings to run commands and command scripts on Horizon desktops when users connect, reconnect, and disconnect.

To run a command or a command script, add the command name or the file path of the script to the group policy setting's list of commands. For example:

date

C:\Scripts\myscript.cmd

To run scripts that require console access, prepend the -C or -c option followed by a space. For example:

-c C:\Scripts\Cli_clip.cmd

-C e:\procexp.exe

Supported file types include .CMD, .BAT, and .EXE. .VBS files will not run unless they are parsed with cscript.exe or wscript.exe. For example:

-C C:\WINDOWS\system32\wscript.exe C:\Scripts\checking.vbs

The total length of the string, including the -C or -c option, should not exceed 260 characters.

Questa pagina è stata utile?

Invia un feedback su questo argomento

Questo argomento è stato utile?

Non includere informazioni personali o riservate.

Generazione del link…