How to Run a Vuser Script from a Command Prompt

This task describes how to replay a Vuser script on a machine from a command prompt or from the Windows Run dialog box—without the VuGen user interface.

To send command line parameters to a Vuser from within VuGen, add the attributes and their values in the Runtime Settings dialog box. For details, see the General > Additional Attributes view.

When you run a script from the command line, VuGen replays it in its basic form. The command line replay will not capture anything related to the UI, since it is absent in this type of run. This excludes the capturing of snapshots and similar runtime settings.

To run a script from a command line or the Run dialog box:

  1. Open a Command Prompt window, or select Start > Run to open the Run dialog box.

  2. Type mdrv followed by the script name, using the following syntax:

    <installation_dir>/bin/mdrv.exe -usr <script_name>  

    where script_name is the full path to the .usr script file, for example, c:\temp\mytest\mytest.usr.

  3. Add other command line options and arguments.

  4. Click Enter. The mdrv program runs a single instance of the script without the user interface. The output files provide the runtime information.

For a complete list of the command line options, type mdrv at a command prompt from VuGen's bin folder, without any arguments.

Note: The Linux command line utility, run_db_vuser, does not yet support many of the standard Windows command line options. For details, see How to Run a Vuser Script from a Linux Command Line.


The following examples provide common usages of a command line expression:
  • You can specify the load generator, as well as indicate the number of times to run the script as indicated by the following example:

    script1  -host pc4  -loop 5 
  • Specify a location for the output files. For example:

    -out c:\tmp\vuser 
  • Specify arguments to pass to your script by using the following format:

    script_name  -arg_name arg_value   -arg_name arg_value

You can retrieve the command line values by parsing the command line during replay, using the parsing functions, such as lr_get_attrib_double. For details, see the Function Reference.

Tip: To further customize your run, set the runtime settings for your script in the configuration files. For details, see How to Configure Runtime Settings Manually.

Back to top