Scripts files can be used to configure the App Volumes workflow before or after the virtualization of individual application packages or Writable Volumes. You can use script files to modify the application and OS compatibility and for user or enterprise-specific requirements.

The script files are only applicable to a Writable Volume or an application package, so they are located inside the volume-specific default folders. There are multiple different scripts and these scripts get triggered at different events during the virtualization of each Writable Volume and application package. Some of these scripts are run in the system service context while others are run in the context of the logged-in user.

Note: Based on the content of the configuration batch scripts, executing them might have an impact on the performance of end-user login experience. Desktop and application availability might be delayed in some cases.

Internal Batch Scripts for App Volumes

The following table provides information about the default scripts which are either created by the App Volumes installer or can be created by the administrator in the default volume-specific folders (%SVAgent\Config\Default\<VolumeType>):

Important: These scripts are only read from the default configuration directories. If the scripts are created in any other location on the base image, Writable Volume, or application package, then such scripts are ignored. VMware does not recommend changing these scripts because the changes are not preserved across App Volumes upgrades.

For more information about the default configuration directories, see Default and Custom Configuration Files.

Script Name Execution Context Description
Prestartup.bat System context Before file and registry database (index information) is read from Writable Volume or an application package.
Startup.bat System context Before virtualizing a Writable Volume or an application package.

Application is still not available to the user at this stage.

Logon.bat User context Before virtualizing a Writable Volume or an application package.

Application is still not available to the user at this stage.

Shellstart.bat User context After virtualization has started for a Writable Volume or an application package, but before services from that package have started.
Startup_postsvc.bat System context After virtualization has started and after services from an application package or a Writable Volume have started.
Logon_postsvc.bat User context After virtualization has started and after services from an application package or a Writable Volume have started.
Allvolattached.bat System context After virtualization has started for all the application packages assigned to the user.
Allvolattached_shellstarted.bat User context After virtualization has started for all the application packages assigned to the user.
Shellstop.bat User context During logoff processing, before virtualization is stopped for all the application packages and Writable Volumes.
Logoff.bat User context During logoff processing, after virtualization is stopped for all the application packages and Writable Volumes.

Customizable Batch Scripts for App Volumes

You can create or modify a different set of scripts in the custom configuration directories, which are not affected by App Volumes agent upgrades. Some of these scripts are run in the user context while others are run in the system service account. For more information about the default configuration directories, see Default and Custom Configuration Files.

Note: Administrator privileges are required for creating or modifying custom batch scripts.

The following table lists these scripts and their corresponding trigger events:

Script Name Execution Context Description
OnPreLoadApp.bat System context Before file and registry database (index information) is read from the Writable Volume or an application package .
OnPostLoadApp.bat System context After Writable Volume or application file/registry database (index information) is read from the Writable Volume or an application package.

Application is still not available to the user at this stage.

OnPreEnableApp.bat System context Before virtualizing a Writable Volume or an application package.

Application is not available to the user at this stage.

OnPostEnableApp.bat System context After virtualizing a Writable Volume or an application package.

Application is already available to the user at this stage.

OnPostEnableAppAsUser.bat User context After virtualizing a Writable Volume or an application package.

Application is already available to the user at this stage.

OnAllAppsEnabled.bat System context After virtualization has started for all the application packages assigned to the user.
Note: You can create this script only on the system volume ( %SVAgent%\Config\Custom.
OnAllAppsEnabledAsUser.bat User context After virtualization has started for all the application packages assigned to the user.
Note: You can create this script only on the system volume ( %SVAgent%\Config\Custom.
OnPreDisableAppAsUser.bat User context Before stopping virtualization for a Writable Volume or an application package.

Application is still available to the user at this stage.

OnPreDisableApp.bat System context Before stopping virtualization for a Writable Volume or an application package.

Application is still available to the user at this stage.

OnPostDisableApp.bat System context After stopping virtualization for a Writable Volume or an application package.

Application is no longer available to the user at this stage.

Note: To run a custom script in the user context, you can add an entry in the registry key, HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run in the base virtual machine, Writable Volume, or application package.

Precedence order of configuration directories

If a custom script file is present in multiple locations, the script file is executed only from the highest precedent configuration location and other versions of the script are ignored.

Precedence order of configuration directories when an application package is processed:
  1. {Volume Root}\{Appstack Volume GUID}\{App GUID}\Config\App

    {Volume Root} - indicates the root of the application package

  2. {Volume Root}\{Writable Volume GUID}\{Writable GUID}\Config\App

    {Volume Root} - indicates the root of the Writable Volume

  3. %SVAgent%\Config\Custom\App
  4. %SVAgent%\Config\Default\App

Precedence order of configuration directories when a Writable Volume is processed:

  1. {Volume Root}\{Writable Volume Guid}\{Writable Guid}\Config\Writable

    {Volume Root} - indicates the root of the Writable Volume

  2. %SVAgent%\Config\Custom\<Writable Type>

    The values of Writable type are profile, uia, or uia_plus_profile.

  3. %SVAgent%\Config\Default\<Writable Type>

    The values of Writable type are profile, uia, or uia_plus_profile.