Configuring a Script in a Virtual Package
AdminStudio 2022 | 23.0 | Virtual Package Editor
For App-V 4.x packages, you can use Virtual Package Editor to configure script information, such as when you want a script to be launched.
Tip:To configure information such as the file in your virtual application that you want to be associated with the script, the icon that should be used for the target, and the command-line arguments that should be used to launch the file, configure the settings for the target that contains the shortcut. To learn more, see Configuring a Target in a Virtual Package.
To configure a script in your virtual package:
1. | In the View List under Application Data, click Shortcuts. |
2. | In the Targets explorer, click the script that you want to configure. |
3. | In the Settings window, configure the settings as needed. For details about each setting, see Scripting Settings. |
To learn how to trigger the appropriate behavior if the script fails, see Causing the App-V Application to Close After a Script Failure.
4. | In the Script window, enter your script: either a one-line command or the body of the script. |
Tip:The Virtual Package Editor lets you configure the settings for more than one script at a time. To learn more, see Configuring the Value of a Setting for More Than One Item at a Time.
Guidelines for Entering Script
Note the following guidelines when you are entering script in the Shortcuts view.
• | If you are entering script for the command script (Scriptbody) type of script, you can use any script language that the client operating system supports. |
• | If you are entering script for the command script (Scriptbody) type of script, you can use command processor commands such as CHDIR and MOVE in your script. |
If you are entering script for the single command (HREF) type of script, command processor commands cannot be used, unless you launch cmd.exe to run the script.
• | The Virtual Package Editor automatically adds the proper escape sequence for a newline character (\n), if appropriate, to the App-V package that it generates. Thus, to end a line and start a new one, simply press Enter; avoid entering a newline character (\n). |
The Virtual Package Editor also automatically adds the backslash character (\) if you enter a backslash, resulting in a double backslash (\\) in the App-V package. Thus, if you are specifying a path, do not use the escape character.
• | If you are entering script for the single command (HREF) type of script, ensure that you enter only one line of script. If you enter more than one line, the Virtual Package Editor ignores all of the lines after the first line. |
Note that if you are using the command script (Scriptbody) type of script, you can enter more than one line of script.
See Also