Using VPSHELL in a SEQUEL script
SEQUEL includes a VPSHELL command that lets you run commands on your ViewPoint client (usually your PC). Using the VPSHELL command, you can specify a character string of up to 2000 characters that references a file or object accessible to the client. You also must specify any parameters needed. If the command contains embedded blanks or special characters, you’ll need to enclose the command with apostrophes (' '). If the command produces results, they display in a window on the client.
You can use VPSHELL to create local results from a SEQUEL script. SEQUEL ViewPoint lets you save view results to your desktop in many popular PC file formats. You also can create a ViewPoint shortcut for your desktop so you can run the script anytime. However, if you are creating work files or performing pre-processing, you need to use VPSHELL to save the results to your desktop.
The following example uses the VPSHELL command in conjunction with the CUSTLIST view that is shipped with SEQUEL in the SEQUELEX library.

Let’s look at the VPSHELL command in detail.
02 VPSHELL CMD('"C:\Program Files\SEQUEL ViewPoint\ViewPoint.exe" /V:systemi/SEQUELEX/custlist /D:C:\Documents and Settings\%userprofile%\Desktop\custlist.xls /F:*xls /Q:y')
The VPSHELL command runs Viewpoint.exe and specifies four switches (parameters). The switches do the following:
- The /V switch specifies the view to run in the format system_name/library/view_name.
- The /D switch tells ViewPoint where to save the results (to the desktop), and the name of the result file (custlist.xls). The wildcard %userprofile% in the path allows any user to save the results to the desktop.
- The /F switch specifies the PC format for the results.
- The /Q switch turns on quiet mode, which prevents messages from popping up during processing.
As defined, the script runs the CUSTLIST view, creates .xls results, and saves the file on the user’s desktop.
If you add the following line to your script, ViewPoint opens the file with the default Windows application associated with the .xls file type (Excel).
03 VPSHELL CMD('"C:\Documents and Settings\%userprofile%\Desktop\custlist.xls"')
After saving your script, you can run it from the ViewPoint Explorer just by double-clicking it.
Creating a shortcut
You also can create a ViewPoint shortcut to run the script. Here’s how:
- Right-click the script object and select Create Shortcut from the drop-down menu.

- Save the icon to your desktop.

- Double-click the shortcut icon to run the script.

Other ways to use VPSHELL
You can use the VPSHELL command many different ways in scripts and drill-down applications. For example, the following command starts Internet Explorer and opens the default home page.
VPSHELL CMD('iexplore')
The following command starts Internet Explorer and opens a specific page.
VPSHELL CMD('"iexplore" "http://www.helpsystems.com"')
You also can create a command that uses the defaults specified in the registry. The following command specifies the path to a specific PDF file. ViewPoint locates the file and opens it using the default program associated with the file type in the registry, in this case Adobe Acrobat or the Acrobat Reader. The file displays in a new window.
VPSHELL CMD('"\\DOCSERVER\mydocs\invoice.pdf"')
Contributed by Steven Smith, Technical Consultant
Need Help? Talk to Us |



