.SEL Selection file syntax

Most users will wish to make selections and de-selections using the GUI as described here.  However the engine actually uses a Unicode text file and so there are times when one may wish to view and exit actual selections.  Be sure you edit and save this file as Unicode (or UTF8) encoded!

The selections file contains distinct sections corresponding to the distinct daily backup selection sets one can specify on the Backup->Selections tab in the pull-down menu.  These sections are: [Everyday], [Sunday], [Monday], [Tuesday], [Wednesday], [Thursday], [Friday], [Saturday], [Weekdays], and [Weekend]. Below is an example of different selections for Tuesday and Wednesday:

     + \\?\E:\test#123\judy2.rtf

     + \\?\E:\test#123\zach.rtf

where the syntax of the above selections is described below.

 International customers can change the definition of Weekend (which defaults to Saturday & Sunday) and Weekdays using the INI keywords weekend and weekdays.

The backup client can end up using multiple selection sets for any given day (though when you select a day/set in the user interface you are editing only that set).  So, as an example, if the day the backup has been launched on is a Saturday, then in the user interface you will be editing just those selections unique to that day, but the engine will do the following

  1. If selections have been specified for 'Saturday', then those selections will be used.
  2. If there are selections for 'Weekend', then those selections will be used as well.
  3. If there are selections for 'Everyday' then those selections will be used as well.

 Microsoft Windows does not allow the following characters in a file or folder name: < > : " / \ | ? * :although you may have a mounted UNIX or Macintosh file system which allows one or more of these characters, so beware!


The syntax of a selections file is relatively straightforward.  The first non-blank character on a line indicates what the line is

   # the line is a comment
   + the line is a selection
   - the line is an exclusion (de-selection)

You may use Windows wildcards (such as * and ?) in selections. 

 Window's doesn't support wildcards on multiple directories, so for example the following doesn't work:  C:\*\*.txt

You may use environment variables in selections and de-selections by embedding them between %, so for example %AppData%.  As a convenience you can use the variable %HOMEUSERS% in your default selections file (specified when you create a white label client) and it will be converted at software install time to C:\Users or C:\Documents and Settings (whatever is appropriate for the machine).

 The environment variables must be define for the user the service runs as, and so for example, the LocalSystem user may not have the environment variable you specified defined!

Microsoft Windows creates a special registry key, HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\BackupRestore\FilesNotToBackup, which the software client will use to perform file exclusions, including on VSS System Component selections as per Microsoft's specification.

 In the GUI you can view the selections actually used for a backup on the Monitor->Details->Selections tab as shown here.

When you put a '/s' on the end of a selection or exclusion, that means that the operation applies to all sub-folders of the selection.  If no '/s' is present then the operation only applies to the contents of the folder specified.   A '/s' after a file is ignored.

In the selection file you may see files and folders with a "\\?\" prepended.  This is Microsoft's way of specifying long pathnames (if they are not used then Microsoft limits a pathname to be 255 characters).

When selections are saved in the GUI they will automatically be categorized.  The following shows one exclusion and 4 selections:

# Deselections -- These have precedence over all Selections
-  \\?\E:\test#123\bad.LNK
# Selections --
+  \\?\E:\data\  /s
+  \\?\C:\Apps\
+  \\?\UNC\WIN-6POAA8S1JV2\share\keydata\ /s
+  $VSS:\SqlServerWriter  /s

+  \\?\C:\Users\*\Documents /s

The first selection has a '/s' so all contents of subfolders within E:\data will be backed up, whereas the second selection is missing the '/s' so only the contents of C:\Apps will be backed up and not any subfolders.

Note how the third selection above is a network share (it has \\?\UNC\ prepended on it which allows specification of long pathnames for network shares) -- it could also have been written as \\WIN-6POAA8S1JV2\share\keydata\ /s

The last selection above is for a VSS System Component (in this case for Microsoft SQL Server). Please visit this article to learn more about VSS System Components.

The last selection above provides an example of using wildcards in selections.

Regular Expressions

In addition to supporting Windows wildcards and environment variables, WholesaleBackup also supports regular expressions, which are like wildcards but much more powerful (though there is a performance penalty for using regular expressions during the scan phase). Regular expressions are surrounded by '<' and '>' in selections and de-selections.

There are two forms of regular expressions used, the first is a simple deselection filter such as:

-  <.*\.(bak)$>

where the initial '.*' indicates match zero or more characters, then the '\.' indicates to match the character '.', then the '(bak)' says to match 3 consecutive characters 'bak' and finally the '$' indicates the end of the string.  So basically, this expression says to deselect any file which ends in '.bak' (or '.BAK' since Windows file names are case insensitive).  Using the or '|' operator, a more complex and powerful deselection filter would be

- <.*\.((bak)|(TMP)|(TEMP)|(LCK)|(LOCK))$>

which will deselect any file name which ends in .BAK, .TMP, .TEMP, .LCK, or .LOCK.  If you wish to include a folder seperator '\' (or a '$') in a regular expression, it must be escaped by a '\' as well, so use '\\' (or '\$') such as in the following filter:

-  <.*((\.Trash)|(\.Trashes)|(\$Recycle\.Bin)|(\\RECYCLER\\))>

More complex regular expressions are used within file or folder paths as part of a selection or deselection, which we refer to as path expressions.  Path expressions must be surrounded by double-quotes '"'.  The following is a simple example of a path expression used as selection:

+ "\\?\C:\Data\<(AB).*>\" /s

which says to select every folder beginning with AB in the C:\Data.  Please note that using Windows wildcards for this example would be much faster and look like the following, and so:

+ \\?\C:\Data\AB*\ /s

 In general if you can make your selection or deselection using Windows wildcards instead of regular expressions, the time the software client spends in the scan phase will be less.  Also, please remember to embed path expressions within double-quotes '"' as shown above.

Regular Expression Syntax




Quote (escape) the next character


Match the beginning of the string


Match any character


Match the end of the string








Regular Expression Closures




Match 0 or more times


Match 1 or more times


Match 1 or 0 times


Match exactly n times


Match at least n times


Match at least n but not more than m times 


Regular Expression Escape Characters




tab(HT, TAB)


newline(LF, NL)




form feed(FF)


Regular Expression Predefined Character Classes




lowercase character


uppercase character


letter [a-zA-Z]




alphanumeric [0-9a-zA-Z]








digits [0-9]




hexadecimal digit [0-0a-fA-F]


non-hexadecimal digit


control character


non-control character






word boundary


non-word boundary




Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Powered by Zendesk