Show more files, and Menu
More files
Display conditions
  • File present
  • Registry test
  • Viewer version
  • Home page
  • Freeware instructions
        Free download
        Example AUTORUN.INF
        Command prompt

  • Retail features
        Retail instructions
        ShRun.INF parameters
        More files - Menu
        Screen options
        Viewer checking
        Example ShRun.INF

  • AutoRun basics

  • Version details

  • Licence and pricing
        This link is online on the Internet Buy now for US$90

  • Email sales/support
  • Introduction

    Normally ShellRun just tries to display one file when it starts, set in the filename parameter. However, ShellRun has these further options:

    Displaying more than one file when ShellRun starts

    If you want to display other files then specify their filenames in up to ten more filenameN parameters. Start with filename1, filename2, etc. up to filename10.

    Here's an example ShRun.INF file that has a main file index.html, a web page. However it also shows README.TXT and a movie

  • These other files are only shown if the main filename is shown successfully.
  • These other files can be any file type, including the same type as the main file.
  • These other files will usually appear "on top of" the main file, with the highest numbered such file on top.
  • No indication is given if there is any problem showing any of these other files, eg if the file does not exist or if there is no viewer.

    Running programs

    Each filename can be a program instead of file. You can use filenameNParam and filenameNSpecialParam parameters to provide a command line to a program. The process is the same as used for the main filename - see here for details.

    This example shows how to show a web page in kiosk mode if Internet Explorer is the default browser:

    filename1SpecialParam=iexplore.exe,-k %F

  • Display a menu of command buttons

    ShellRun can display a list of command button options in its popup window, as shown in this example, which has a menu on the left, and a sub-menu shown when the "Play videos" button is clicked:

    Screenshot of the ShellRun popup window with menu
(retail version)

    To configure the appearance of the buttons, see the Screen appearance page.

    The ShellRun menu is made up of the filename and filenameN parameters which have associated filenameMenu and filenameNMenu parameters. The 'menu' parameters specify the text to go on the command button. If a 'filename' parameter has a 'menu' equivalent, then the filename is not shown straight away, but only shown if the user clicks on the relevant command button.

    To obtain a sub-menu for one of the main buttons, keep the filenameMenu or filenameNMenu parameter, but miss out the correspnding filename or filenameN parameter. Then: add in up to 10 more corresponding sub-menu items, as follows,
       Filename_1, Filename_1Menu, Filename_2, Filename_2Menu, etc
       FilenameN_1, FilenameN_1Menu, FilenameN_2, FilenameN_2Menu, etc.
    You cannot supply Condition, Param or SpecialParam options for sub-menu items.


    This example shows the contents of the ShRun.INF file to make the above screenshot:

    filenameMenu=Play CD Audio
    filename1Menu=Show web site on CD
    filename2Menu=Read documentation
    filename3Menu=Play video
    filename3_1Menu=Product video
    filename3_2Menu=How to video
    filename3_3Menu=Out-takes video

    Popup window configuration

    If a menu is display, then the popup window by default is centered on the user's screen. You can override the window position by setting the xPos and yPos parameters. If you use a Splash window, you may want to reposition it so that it does not obscure the popup window.

    By default, the menu buttons appear below the information and message text. However you can override this by setting the xMenu and yMenu parameters.

    If you want the popup window to close when the user clicks on any button then add 2 to the value of the ShowOptions parameter.

    The ShowTime parameter determines how long the popup window stays on screen. Set this to -1 to keep the popup window permanently on display. If you want the first menu option to be displayed when a timeout expires, then add 4 to the value of the ShowOptions parameter.

    File display conditions

    You can make the display of any file conditional, ie for filename and filename1 to filename10. Each file is only displayed if the condition evaluates to true.

    The condition (or conditions) for each file are specified in separate parameters in ShRun.inf. For filename the condition is specified in FilenameCondition. The other conditions are set in parameters Filename1Condition to Filename10Condition.

    ShellRun's viewer checking still operates, so you can handle cases where no viewer is installed for the main filename. Note that this viewer checking is done first, before any display conditions are checked.


    In this example, ShellRun displays one of three presentation files depending on which version of PowerPoint is installed. The v command is used to test the viewer executable filename and version; a full explanation of the syntax is given below.
    • If PowerPoint 2000 or later is installed then intro2k.ppt is shown
    • If an earlier version of PowerPoint is installed then intro97.ppt is shown
    • If another PowerPoint viewer is installed (eg PowerPointViewer) then intro.ppt is shown
    • If no viewer is installed at all, then ShellRun displays a message saying no viewer is available. (If you add ShellRun parameters to install PowerPointViewer, then it tries to show intro.ppt after the installation has completed.)

    Condition syntax

    Each condition parameter can contain one or more condition elements, where each condition element is either a test or a boolean operator. Do not put any spaces in conditions, unless they are needed as a part of file or registry key names.

    Command Description  
    f File present test See below
    r Registry test See below
    v Viewer filename or version test See below
    & Boolean AND  
    | Boolean OR  
    ! Boolean NOT  

    The question mark ? character separates commands and their arguments. Given that the f command simply tests whether a file is present on the user's computer, consider the following example:

    • filename is shown if C:\test1.txt is present.
    • filename1 is shown if C:\test1.txt is not present.
    • filename2 is shown if C:\test1.txt and C:\test2.doc are present.
    • filename3 is shown if C:\test1.txt or C:\test2.doc are present.
    • filename4 is shown if C:\test1.txt is present or C:\test2.doc is not present.
    Note that the Boolean OR | and NOT ! command characters look similar, so be careful when you use them.

    File conditions

    The file command f tests if a file is present on a user's computer. Put a ? after the f and then follow this by the name of the file you want to test for, usually including the drive letter. If you only want to proceed if a file is not there, then precede the condition with a Boolean NOT ! command.

    In this example, ShellRun shows instlld.htm if file trial.exe is present (in the expected directory, C:\Program files\PHD\test\) ; ShellRun shows noinst.htm if trial.exe is not present.

    FilenameCondition=f?C:\Program files\PHD\test\trial.exe
    FilenameCondition=!?f?C:\Program files\PHD\test\trial.exe

    Testing for specific files has a drawback: the file may not be in the place you expect. For example, the user may have installed a program to an unusual directory, or deleted, renamed or moved the file. It is usually therefore better to use a registry test if this possible.

    Registry conditions

    The registry command r tests a registry key value on a user's computer. It can test whether the registry key value is present, or do various comparisons.

    Sub-command type Syntax Example
    Key value present keyname r?HKEY_CURRENT_USER\Software\PHD\test\Settings\Loaded
    Key value equals keyname=value r?HKEY_CURRENT_USER\Software\PHD\test\Settings\Loaded=1
    Key value greater than keyname>value r?HKEY_CURRENT_USER\Software\PHD\test\Settings\version>0x0102
    Key value less than keyname<value r?HKEY_CURRENT_USER\Software\PHD\test\Settings\version<1234

    The keyname consists of a registry key and the value name. If you use Windows Registry Editor, the keys are displayed on the left, while the value names are displayed on the right; put both these elements together (with a \ character in between) to make the keyname.

    The keyname must start with one of these root key names:

    The value name can be blank, in which case you are testing the default string value - shown as (Default) at the top of the value name list in the Registry Editor.

    Registry values can have various types. If ShellRun finds that the keyname value is type DWORD, then it interprets the comparison value as a number; the value can then be an ordinary decimal number, or in hexadecimal if it is preceded by 0x.

    If the keyname value is type DWORD, then numeric comparisons are done. For all other key types, a string comparison is done. (String comparisons < and > do work, albeit strangely: a is less than z, but Z is less than a.)

    In this simple example, ShellRun only shows file upgrade.htm if DWORD registry key value HKEY_CURRENT_USER\Software\PHD\test\Settings\Version is less than 4.


  • Viewer conditions

    The viewer command v tests the viewer that the user has for the display file. ShellRun can test the viewer executable version and filename. (If no viewer is installed for the main filename, then the separate viewer checking ShellRun parameters are run instead of these conditions.)

    Viewer executable filenames and versions

    Each display file has an associated viewer (if a viewer is installed). See below for filename and version details of some typical applications.

    For a Microsoft Word file intro.doc, the viewer executable might be C:\Program Files\Microsoft Office\Office10\WINWORD.EXE with version 10.0.4219.0 if Word XP is installed. In this case ShellRun ignores the directory and considers the viewer executable filename to be WINWORD.EXE.

    Windows program version numbers are 4 numbers (each in the range 0 to 65535). For example, the Acrobat Reader viewer 5.01 is in file AcroRd32.exe which has file version The numbers to the left are most significant.

    You can use the ShellRun Viewer Browser to determine the viewer and viewer version for a file type on your computer. Alternatively, locate the viewer program using Windows Explorer. Right-click on the program icon and select Properties then the Version tab. The file version number is listed at the top.

    Viewer condition commands

    Sub-command type Syntax Example
    Version greater than or equal version1 v?
    Version range version1:version2 v?
    Version greater than or equal,
    filename test
    version1,filename1 v?,winword.exe
    Version range,
    filename test
    version1,filename1:version2,filename2 v?,winword.exe:,winword.exe
    Not filename test not,filename1 v?not,winword.exe

    • For the "Version range" test, the condition succeeds if the viewer executable version is greater than or equal to version1 and less than version2.

    • For the "filename" tests, the condition fails if the viewer executable filename does not match that given in filename1 or filename2.

    • For the "not filename" test, the condition succeeds if the viewer executable filename does not match that given in filename1.


    In this example, we only want to show one of three files: intro2k.ppt if PowerPoint 2000 or later is installed, intro97.ppt if an earlier version of PowerPoint is installed, or intro.ppt if any other viewer is installed (ie PowerPoint Viewer).

    • PowerPoint 2000 typically has version number
    • For PowerPoint, the viewer executable has always been PowerPnt.exe. For PowerPoint Viewer, the current executable is ppview32.exe.
    • You can use the ShellRun Viewer Browser to determine the viewer executable and version for a file type on the current computer. See below for the results for some typical applications.
    Working backwards:
    • intro2k.ppt is shown if the viewer filename is PowerPnt.exe and the viewer version is 9 or greater, ie PowerPoint 2000 or later.
    • intro97.ppt is shown if the viewer filename is PowerPnt.exe and the viewer version is greater than or equal to 0 and less than 9, ie an earlier version of PowerPoint.
    • intro.ppt is shown if the viewer filename is not PowerPnt.exe, ie if the installed viewer is PowerPoint Viewer.
    The "not,PowerPnt.exe" case is deliberately put first. If no viewer is available, then ShellRun can be set up to install the PowerPoint Viewer. When installation is complete, ShellRun will again try to display the filename. In this case it is correct for file intro.ppt to be shown.

    Common application versions

    This section gives a guide to the version numbers and executable filenames used by some of the most common viewer applications. These are typical values - not a definitive list. Some older versions of Windows may not display a full set of 4 digits for a version number.

    In general, application version numbers reflect the program version number for their first number. The less significant numbers can usually be ignored, so to test for Word 2000 only specify, ie anything where the first version number is 9.

    For Office viewer applications, the version number seems to indicate the lowest version they cope with, eg Word Viewer has version which would seem to indicate - correctly - that it will cope with Word 97 files or later (because Word 97 also starts with 8, ie

    Application File extension Typical version number Executable filename
    Acrobat 4 .pdf Acrobat.exe
    Acrobat 5 .pdf Acrobat.exe
    Acrobat 6 .pdf Acrobat.exe
    Acrobat Reader 4 .pdf AcroRd32.exe
    Acrobat Reader 5 .pdf AcroRd32.exe
    Excel 2000 .xls Excel.exe
    Excel XP 2002 .xls 10.0.4524.0 Excel.exe
    Excel Viewer .xls XlView.exe
    Internet Explorer 6 .htm .html 6.0.2800.1106 iexplore.exe
    Mozilla .htm .html mozilla.exe
    Netscape 3 .htm .html netscape.exe
    Netscape 4.73 .htm .html netscape.exe
    Netscape 6 .htm .html netscp6.exe
    Netscape 7 .htm .html netscp.exe
    Opera 6 .htm .html 6.0.1107.0 opera.exe
    PowerPoint 2000 .ppt PowerPnt.exe
    PowerPoint XP 2002 .ppt 10.0.4205.0 PowerPnt.exe
    PowerPoint Viewer .ppt ppview32.exe
    Word 6 .doc WinWord.exe
    Word 97 .doc WinWord.exe
    Word 2000 .doc
    Word XP 2002 .doc 10.0.4219.0 WinWord.exe
    Word Viewer .doc WordView.exe
    WordPad .doc 5.1.2600.1106

    ShellRun Home Last modified: 9 June 2009 ShellRun online