Command Lines for Snap XMP Desktop
Opening a survey
Option | Secondary option | Online/Offline | Description | Example |
“filename” |
| offline | Opens with the survey filename. This is equivalent to double-clicking on the file. The operation distinguishes between MDF, ADF, TMDF files. | “snap Desktop.exe” “snSurvey.mdf” |
/S |
| Opens the last used survey | “snap Desktop.exe” /S | |
/S “filename” |
| offline | Opens the named survey. | “snap Desktop.exe” /S “snSurvey.mdf” “snap Desktop.exe” /S “c:\myfloder\snSurvey.mdf” |
/S “path\” |
| offline | Opens with the current survey overview folder set to path Make sure to include the trailing ‘\’. | “snap Desktop.exe” /S “c:\myfolder\” |
/S {surveyid} |
| online | Opens an online survey using the SOL id (a guid). – Requires the server and account details to be set up first (including “remember credentials”) -The {surveyid} can be found from “Tailor|Online Details…” when the survey is open. | “snap Desktop.exe” /S {541963AE-B5AF-4D6D-95E8-804B196E5687} don’t use quote marks unless you have an offline survey named after a guid for some reason. |
/S #”filename” |
| online | Use # to open an online survey using the display name in the root folder (“my work”) – Requires the server and account details to be set up first (including “remember credentials”) | “snap Desktop.exe” /S #”snSurvey” |
/S #”path\filename” |
| online | Use # to open an online survey, specify folder names from the root folder using backslash(\) – Requires the server and account details to be set up first (including “remember credentials”) | “snap Desktop.exe” /S #”folder\snSurvey” |
/S #”\filename” |
| online | Use # with a leading backslash to open an online survey in any online folder. – Requires the server and account details to be set up first (including “remember credentials”) – If there is more than one match then the command line will fail. | “snap Desktop.exe” /S #”\snSurvey” “snap Desktop.exe” /S #”\folder\snSurvey” |
Repairing a survey
Option | Secondary option | Online/Offline | Description | Example |
/S | /R | offline | Repair the named survey. | “snap Desktop.exe” /S “snSurvey.mdf” /R |
Updating a survey
Option | Secondary option | Online/Offline | Description | Example |
/S | /U |
| Update the named survey. Opens, upgrades (if needed), syncs data cases if online, then closes. | “snap Desktop.exe” /S “snSurvey.mdf” /U “snap Desktop.exe” /S “c:\myfolder\snSurvey.mdf” /U |
Exporting and Importing a SNIF file
Option | Secondary option | Online/Offline | Description | Example |
/S | /EX | offline | Export the named survey to a SNIF file. If no SNIF filename is specified, then the survey is exported to the clipboard. | “snap Desktop.exe” /S “snSurvey.mdf” /EX “snSurvey.sif” |
/IS “filename” |
| offline | Import a SNIF file. | “snap Desktop.exe” /IS “snSurvey.xml” |
Run a report
Option | Secondary option | Additional options | Description | Example |
/S | /B “batch” |
| Execute the named batch report. The export method is specified by the current tailoring. | “snap Desktop.exe” /S “snSurvey.mdf” /B “bt1” |
| /F “expression” | Apply a filter. | “snap Desktop.exe” /S “snSurvey.mdf” /B “bt1” /F “Q1=1” | |
| /N “printname” | Specify the Name of the print job. Only useful when using a program like Ghost script to turn the job name into a file name | “snap Desktop.exe” /S “snSurvey.mdf” /B “bt1” /N “output.pdf” | |
/C q = “val” | Specify the value of q@context | “snap Desktop.exe” /S “snSurvey.mdf” /C q1=1 /C q2=”example” /B bt1 | ||
| /XS “filename” | Specifies the eXternal Survey when running a suitable batch report | ” snap Desktop.exe” /S “snSurvey.mdf” /XS “snBenchmarks.mdf” /B bt1 |
Print from the Questionnaire window
Option | Secondary option | Additional options | Description | Example |
/P “filename” | Print questionnaire design window | “snap Desktop.exe” /P “snSurvey.mdf” | ||
/S | /P |
| Print questionnaire design window | “snap Desktop.exe” /S “snSurvey.mdf” /P |
/V | Print values from the raw data (data view of design window, all cases) | “snap Desktop.exe” /S “snSurvey.mdf” /P /V | ||
/V “dbLink” | Print values from the named data base link (Panel data view of design window, all cases) data link must be an ‘import all cases’ type. dbLink name is case sensitive. | “snap Desktop.exe” /S “snSurvey.mdf” /P /V “Customer Details | ||
| /V /F “expression” | Apply a filter. | “snap Desktop.exe” /S “snSurvey.mdf” /P /V /F “case <= 10” | |
/V /O sep “dbLink” | Print panel view data cases separated into separate print jobs | “snap Desktop.exe” /S “Survey.mdf” /P /V /O sep | ||
| /ED “edition” | Specify the edition to use in the design window. The name must be an exact match, including any spaces. | “snap Desktop.exe” /S “snSurvey.mdf” /P /ED “Paper: Keyed” | |
/L “lang” | Specify the Language to use in the design window. Use either the name of the language or the 2 letter code. | “snap Desktop.exe” /S “snSurvey.mdf” /P /ED “Paper: Keyed” /L “French” | ||
| /N “printname” | Specify the Name of the print job. Only useful when using a program like Ghost script to turn the job name into a file name | “snap Desktop.exe” /S “snSurvey.mdf” /P /N “output.pdf” |
Run a database link
Option | Secondary option | Online/Offline | Description | Example |
/S | /DB “dblink” | Execute a named database link from the data entry window. dbLink name is case sensitive. | “snap Desktop.exe” /S “snSurvey.mdf” /DB “Customer Details” |
Open with a specified window
Option | Secondary option | Additional options | Description | Example |
/S | /Q |
| Open survey with the Questionnaire design window open | “snap Desktop.exe” /S “snSurvey.mdf” /Q |
/ED “edition” | Specify the edition to use in the design window. The name must be an exact match, including any spaces. | “snap Desktop.exe” /S “snSurvey.mdf” /Q /ED “Paper: Keyed” | ||
/L “lang” | Specify the language to use in the design window. Use either the name of the language or the 2 letter code. | “snap Desktop.exe” /S “snSurvey.mdf” /Q /L “fr” | ||
/D | Open survey with the Data entry window open | “snap Desktop.exe” /S “snSurvey.mdf” /D | ||
/B | Open the Batch reports overview | “snap Desktop.exe” /S “snSurvey.mdf” /B | ||
/T | Open survey with the results overview window open (Tables) | “snap Desktop.exe” /S “snSurvey.mdf” /T | ||
/W | Open survey with the weights overview window open. | “snap Desktop.exe” /S “snSurvey.mdf” /W |
Running options
Option | Description | Example |
/y | Suppress message boxes without logging | “snap Desktop.exe” /S “snSurvey.mdf” /B bt1 /y |
/Y | Suppress message boxes and record the messages and default answers in file SnapMessageLog.txt. The output file is in the “all users public documents” area, typically C:\Users\Public\Documents\Snap Desktop\SnapMessageLog.txt, provided that the user has write access | “snap Desktop.exe” /S “snSurvey.mdf” /B bt1 /Y |
/Y “filename” | As above, but the user can specify the location of the log file. | “snap Desktop.exe” /S “snSurvey.mdf” /B bt1 /Y “c:\myfolder\mylog.txt” |
-#num | Selects a licence when multiple licences are available. ‘num’ is the index of the licence file. | “snap Desktop.exe” -#1 |
General considerations
You may leave out speech marks, but they are always required if the value contains either a space or a forward slash ‘/’. Note that “snap desktop.exe” contains a space, and so must appear within quotes.
Speech marks are always double quotes, single quotes are not supported.
Most options ignore case; however the case-sensitive options are: /y, /Y, /DB “dbLink”, and /V “dbLink” where the correct case has to be used for the “dbLink” name.
Return values
The program returns 0 if the command line is successful.
- 0: Success
- 1: Unspecified Error
- 2: File Not Found
- 3: File Access Error
- 4: Data Error
- 5: Object Not Found
- 6: Process Aborted
- 7: Licence Error
- 8: Terminal Error
- 9: Repair Failed
- 10: Validation Failed (eg SOL login)
- 11: Action Not Supported (eg some command line options do not work with online surveys)
- Other value: Unexpected Error