Start-ProgramAs

Runs an application under a different user account than the current account. This allows an application to run with more extensive permissions than the current login allows, for example.

Note: Starting with version 3.0 of the PPB, the Start-ProgramAs command can also be generated by dragging and dropping batch files and executable files (*.cmd, *.bat and *.exe) into the script window. If the files are already in the package directory, the source path is referenced relatively with .\, if the source files are outside the package directory, the full path is taken.


Settings:

  • Executable
    Specifies the file to be executed including the path. Variables are allowed. Use the "..." button to select an existing file (on the packaging system) or enter the path manually. Unlike as with the Start-Program command, you must not specify any command line parameters here.
  • Use a different working directory
    If this option is activated, a working directory other than the application directory can be specified for the execution.
  • Text field for working directory
    Path to the alternative working directory. The use of variables is possible. Use the "..." button to select an existing directory (on the packaging system) or enter the path manually.
  • Parameters
    Specify the parameter you want to pass to the executable file call.
  • Variable name for returncode
    Optional - Name of a variable that holds the returncode of the called command line. If the command execution terminates with a timeout, the variable contains the return value TimedOut. Enter only the name of the variable, not the $ sign and the curly brackets.
  • As value with sign
    If this option is activated, the return value is interpreted as signed double word.
  • Account
    Specifies the credentials under which the command line is executed.
    • Use this account
      This option can be used to explicitly specify the credentials with which the command line is executed.
      • User name
        The user account under which the application is to run. This is entered as USERNAME for local accounts or DOMAIN\USERNAME for domain accounts.
      • Password
        The password of the specified account.

Note: Please note that the password for the user is only stored obfuscated in the script and can therefore possibly be determined by experienced users. It is therefore recommended, to choose one of the other options for the account.

    • Use the interactively logged-on user
      The application is executed in the context of the user that has the interactive session.
    • Use the executing user
      The application runs with the credentials that is executing the package.
    • Use the local system account
      The application runs under the local system account.
  • Do not run as administrator
    If User Account Control (UAC) is enabled, Start-ProgramAs always executes the specified commandline as administrator by default, unless this option is activated, e.g. if a certain website is called and you want to prevent this from happening with administrative rights for security reasons.
  • Logon
    If you want the script to run under a defined user account, this option determines how the account profile is handled.
    • Logon without profile
      The user profile is not loaded. No changes are written to the user profile after the script is executed.
    • Logon with profile
      The user profile is loaded; changes are written to the user profile.
    • Logon with network only
      The script itself is executed in the context of the current user account. The specified user account is only used for network access, i.e. a logon session is opened under the specified user account. 
  • Options
    Allows you to specify further execution options.
    • Wait for execution
      If this option is enabled, the script waits for the called process to complete before continuing to execute the script.
    • Max wait time [min]
      Time in minutes to wait for the process to be completed. If the process is not terminated within this time, package execution continues anyway and the variable for the returncode gets the value TimedOut.
    • Create Application Window
      How should the application window of the called process be displayed.
      • Normal
        The application window is shown normally.
      • Minimized
        The application window is minimized and only displayed as an icon in the taskbar.
      • Hidden
        The application window is hidden and not visible to the user.
    • Use 32-Bit mode on x64 computer
      If the script is executed on a 64-bit operating system, the counterpart for 32-bit applications SysWOW64 can be used automatically when referring to the SYSTEM32 directory.
    • Do not log command line parameters
      The command or variable is not written to the log file. This option prevents sensitive information contained in the command line, such as license keys or passwords, from being read out via the log file.
    • What should happen, if the command execution fails
      Defines the behavior when an error occurs during command execution.
      • Continue execution of package 
        Package continues with the next command. 
      • Stop execution and notify as 'failed' 
        The package execution is aborted. 


Example:

The example below calls up the greenshot setup with the parameters for a user-independent installation and waits a maximum of three minutes for completion:


Corresponds to DSM eScript commands:

  • RunAs
  • RunAsEx


See also: