Next Topic

Previous Topic

Book Contents

executeFileInDirectoryPath()

Same as executeFile() except the location of the .exe file is located at the path returned from a getDirectoryPathFromRegistry() command.

If Execute as the logged on user is selected, then a credential must be specified by running either the impersonateUser() or useCredential() command before this command. If run Execute as the system account is selected, execution is restricted to the agent's system level access.

Note: To avoid risk of privilege escalation attacks, scripts and files which run under System context, or as an Administrator level user, should be executed from a folder with locked down ACL permissions. The VSA agent provides a default folder called "System", under the Agent Working Directory, which is intended for this use. It can be stored as a variable by selecting "Secure Agent Working Directory Path" from the getVariable() command.

Example

getDirectoryPathFromRegistry(HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Adobe\Adobe Acrobat\9.0\Installer\Acrodist.exe", "All Operating System, "Halt on Fail")
executeFileInDirectoryPath(" ", " ", "Execute as System and Continue", "All Operating Systems", "Halt on Fail")