Run a Query script 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:
"Winshuttle.Studio.Console.exe full path" -SapQuery -run"<Query script name with full path>" [parameters - optional]
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 script name with full path".
For example, 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 v11 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.
Command reference
Parameter |
Description |
Example |
-alf |
Name of the auto logon credential |
-alf"W6r-800-someone" |
-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 Foundation |
-scd"true" |
-slf |
SQL logon file |
-sql"someone-sql-cred" |
-sys |
SAP system name |
-sys"W6r" |
-cli |
Client |
-cli"800" |
-rtv |
Run time variables |
-rtv"TableName.FieldName#Value1#Value2|Value3##Value4|Value5|Value6~TableName.FieldName#Value1#Value2" |
Note: The account that you use to write to SQL Server must have db_owner or db_ddladmin membership on the database that contains the target table.