Run a Query solution from the command line

All commands that run at the command prompt take precedence over the same commands that are already contained in the Query file.

Note: To ensure that the log messages are saved, set the Excel save option to Save at end of run.

You can run a Query script from the command line using this syntax (note that this works even if the data file does not exist):

"Winshuttle.Studio.Console.exe full path" -SapQuery -run"<Query solution name>” -lib"Qxq lib" -tms"MY App"

Note: This command requires "Winshuttle.Studio.Console.exe full path" to be enclosed in double quotes. In addition, ensure that there is a single space between "Winshuttle.Studio.Console.exe full path" and "Query solution name".

Example 1: Note that this applies to solutions run locally. If you want to execute Sample.qsq in the default location at C:\MyDocuments\Winshuttle\Studio\Script\, the command line syntax is:

"C:\Program Files\Winshuttle\Studio\Winshuttle.Studio.Console.exe" -SapQuery -run"C:\MyDocuments\Winshuttle\Studio\Script\Sample.qsq"

This command launches Studio with the Sample.qsq file loaded and starts executing the Query script. You can test this command line operation by running this command in the Windows Run dialog box.

Example 2:  Note that this applies to solutions run from Evolve. The command line syntax is: 

“C:\Program Files\Winshuttle\Studio\Winshuttle.Studio.Console.exe>" -SapQuery -run"Sample" -rfn"C:\Users\msharma\Documents\Winshuttle\Studio\Data\Sample.xlsx" -cnn"W6R Non Prod" -lib"Query lib" -tms"Ms App" -dsr"2" -der"0" -rsn"Test Run reason" -eml"abc@aaa.com" -arf"True" -dsw"True" -irr"True"

Command reference

Parameter Description Example
-drs Set the run sheet

-drs"SheetName"

-cnn

AP connection name

cnn"W6r-n-800"

-lib Library name -lib"Query lib"
-scn SQL connection name -scn”SQl1001”
-tms Teamspace name -tms"Ms App"

-arf

Attach the data file with the posting results

-arf"true"

-dsw

Disable the production server warning

-dsw"true"

-rfn

Result file name

-rfn"C:\Users\centraluser\Desktop\MM02.xlsx

-eml

Send notification email on schedule confirmation

-eml"someone@winshuttle.com,someone@example.com"

-irr

If run reason is required or not

-irr"true"

-rsn

Run reason

-rsn"This is a demo run"

-dsr

Start Row

-dsr"5"

-scd

Save to Evolve

-scd"true"

-slf

SQL logon file

-slf"someone-sql-cred"

-sys

SAP system name

-sys"W6r"

-clf

Client

-cid"800"

-rtv

Run time variables

-rtv"TableName.FieldName#Value1#Value2|Value3##Value4|Value5|Value6
~TableName.FieldName#Value1#Value2"