Asset Export Command Line Parameters

Use the STWExport.exe command line utility to export assets from the command line. Export parameters can be specified entirely from a command line, or unless otherwise noted, specified in a configuration file.

The utility is located in \Silk\Silk Test\ng\gui\

Command Line Export Parameters

Syntax Values Required Description
Username (-u) User-defined Yes

The name of the user used to connect. It can only be specified using the command line. Any configuration file specification for this parameter is ignored. When using Windows authentication, omit the user name.

Password (-p) User-defined Yes

The password of the user used to connect. This parameter is required if the password is not Nothing. It can only be specified using the command line. Any configuration file specification for this parameter is ignored. When using Windows authentication, omit the password.

DSN (-d) User-defined Yes

The name of the DSN to use to connect to the database. This parameter is required for any DSN names other than "SilkTest". It can only be specified using the command line. Any configuration file specification for this parameter is ignored.

ExportFile (-ef) User-defined Yes The file name or location of the ZIP file to be exported.
Execute (-ex) Yes | No (see Note below) Yes Commits the export operation. The default value is "No".
Filename (-f) User-defined No
An INI configuration file that stores command line parameters. It can only be specified using the command line.
Note: The INI file parameters override the command line parameters with one exception. The Projects (-prj) and System (-s) parameter values specified in the INI file do not override the same parameters specified on the command line. Instead the values for each are both used.
AllVersions (-av) Yes | No (see Note below) No Exports all versions of the asset(s). The default value is "No".
ReportResult (-rr) User-defined No

Contains the file name and location of the summary report file to be created. The default location is the current directory.

SilentMode (-sm) Yes | No (see Note below) No

Prevents the display of the console output.

Projects (-prj) Asset nodes No Specifies a single project asset or group of project assets for export. All assets in the database are exported without this parameter. Groups of nodes are separated by the pipe character(|). The format is: {ProjectName}.{AssetType}.{AssetName}.{Ver#}. For example: -prj ProjectA.Visualtest.SampleTest.1 Strings separated by the pipe character ( | ) must be included within double quotes. For example, -prj "Common | ProjectB.Result"
Note: When specifying the asset type, use the singular form of the asset. For example, use "result" not "results". For asset names comprised of two words (visual test), remove the space (visualtest). There is one exception: test script. Use only the word "script" to specify a test script.
System (-s) Asset nodes No Specifies a single project asset or group of project assets for export. All system assets in the database are exported without this parameter. Groups of nodes are separated by the pipe character ( | ). The format is: {SystemName}.{SystemType}.{SystemAssetName}. For example: -s Options.Record.RecA Strings separated by the pipe character ( | ) must be included within double quotes.
ExportAssociated (-ea) Yes | No (see Note below) No To ensure that all referenced assets are exported from every project in the database. The default value is "No".
OverwriteFile (-of) Yes | No (see Note below) No Overwrites the existing file (including read-only files) if there is a file name conflict during export. The default value is "Yes".
Note: To specify the default value of a command line parameter, simply omit the parameter from the export command. To specify the non-default value, include only the parameter without its value. For example, to export all versions of an asset, include the AllVersions (-av) parameter without a "Yes" value from your export command. To export only the latest version of an asset, simply omit this parameter to effect the default value of "No".

When specifying parameter values in the export configuration file, the default value is used whenever a parameter or parameter value is omitted. For non-default values, the value must be explicitly stated. For example, to export all versions of an asset, include the AllVersions (-av) parameter together with the value "Yes".

Example

C:/>STWExport.exe -u Admin -p admin -d MyDBName -mn "c:\MySTAssetFiles" -mt ds -rr "c:\STExport.txt" -prj ProjectA -ex

In the example above, the latest version of asset files in ProjectA are exported to C:\MySTAssetFiles and a file is created that contains a summary report of the export.

Example with Configuration File

C:\>STWExport.exe -u Admin -p admin -d YourDBName -f "C:\STexport.ini"