[Toc][Index]

SELECT - Select files for a command

 
 Purpose:    Interactively select files for a command. 
             
 Format:     SELECT [/A[[:][-][rhsda]] /D /E /H /I"text" /J /L 
             /O[:][-]adeginrsu /T:acw /Z] [command ] ... (files ...)... 
             
             command :  The command to execute with the selected files. 
             files :  The files from which to select.  File names may be 
             enclosed in either parentheses or square brackets.  The 
             difference is explained below. 
             
             /A(ttribute select)             /J(ustify names) 
             /D(isable color coding)         /L(ower case) 
             /E (use upper case)             /O(rder) 
             /H(ide dots)                    /T(ime) 
             /I (match descriptions)         /Z (use FAT format) 
 
 File Selection 
 Supports extended wildcards, ranges, multiple file names, and include 
 lists.  Ranges must appear immediately after the SELECT keyword. 
 Usage 
 SELECT allows you to select files for internal and external commands by 
 using a full-screen "point and shoot" display.  You can have SELECT 
 execute a command once for each file you select, or have it create a list 
 of files for a command to work with.  The command can be an internal 
 command, an alias, an external command, or a batch file. 
 If you use parentheses around the files, SELECT executes the command once 
 for each file you have selected.  During each execution, one of the 
 selected files is passed to the command as an argument.  If you use 
 square brackets around files, the SELECTed files are combined into a 
 single list, separated by spaces.  The command is then executed once with 
 the entire list presented as part of its command-line arguments. 
 Using the SELECT File List 
 When you execute the SELECT command, the file list is displayed in a 
 full-screen format which includes a top-line status bar and shows the 
 command to be executed, the number of files marked, and the number of 
 Kbytes in those files. 
 SELECT uses the cursor up, cursor down, PgUp, and PgDn keys to scroll 
 through the file list.  You can also use character matching to find 
 specific files, just as you can in any popup window.  While the file list 
 is displayed you can enter any of the following keys to select or 
 unselect files, display files, execute the command, or exit: 
 + or space               Select a file, or unselect a marked file. 
 -                        Unselect a marked file. 
 *                        Reverse all of the current marks (except those 
                          on subdirectories).  If no files have been 
                          marked you can use * to mark all of the files. 
 /                        Unselect all files. 
 Ctrl-L                   View the current highlighted file with LIST 
                           When you exit from LIST, the SELECT screen will 
                          be restored. 
 Enter                    Execute the command with the marked files, or 
                          with the currently highlighted file if no files 
                          have been marked. 
 Esc                      Skip the files in the current display and go on 
                          to the next file specification inside the 
                          parentheses or brackets (if any). 
 Ctrl-C or Ctrl-Break     Cancel the current SELECT command entirely. 
 
 On FAT drives the file list is shown in standard FAT directory format, 
 with names at the left an descriptions at the right.  On HPFS drives the 
 format is similar but more space is allowed for the name, and the 
 description is not shown.  In this format long names are truncated if 
 they do not fit in the allowable space.  For a short-name format 
 (including descriptions) on long filename drives, use the /Z switch. 
 When displaying descriptions in the short filename format, SELECT adds a 
 right arrow [>] at the end of the line if the description is too long to 
 fit on the screen.  This symbol will alert you to the existence of 
 additional description text.  You can use the left and right arrow keys 
 to scroll the description area of the screen horizontally and view the 
 additional text. 
 You can display the filenames in color by using the SET command to create 
 an environment variable called COLORDIR, or using the Commands page of 
 the OPTION dialogs or a text editor to set the ColorDir directive in your 
 CMD.INI file.  If you do not use the COLORDIR variable or the ColorDir 
 directive, SELECT will use the default screen colors for all files.  See 
 the discussion of color-coded directories under DIR for more details.  To 
 disable directory color coding within SELECT, use the /D option. 
 You can set the default colors used by SELECT on the Commands page of the 
 OPTION dialogs or with the SelectColors and SelectStatBarColors 
 directives in the .INI file.  If SelectColors is not used, the SELECT 
 display will use the current default colors.  If SelectStatBarColors is 
 not used, the status bar will use the reverse of the SELECT colors. 
 Creating SELECT Commands 
 In the simplest form of SELECT, you merely specify the command and then 
 the list of files from which you will make your selection(s).  For 
 example: 

 
         [c:\] select copy (*.com *.exe) a:\
 
 
 will let you select from among the .COM files on the current drive and 
 will then invoke the COPY command to copy each file you select to drive 
 A:.  After the .COM files are done, the operations will be repeated for 
 the .EXE files. 
 If you want to select from a list of all the .COM and .EXE files mixed 
 together, create an include list inside the parentheses by inserting a 
 semicolon: 

 
         [c:\] select copy (*.com;*.exe) a:\
 
 
 Finally, if you want the SELECT command to send a single list of files to 
 COPY, instead of invoking COPY once for each file you select, put the 
 file names in square brackets instead of parentheses: 

 
         [c:\] select copy [*.com;*.exe] a:\
 
 
 If you use brackets, you have to be sure that the resulting command (the 
 word COPY, the list of files, and the destination drive in this example) 
 does not exceed the command line length limit of 1,023 characters.  The 
 current line length is displayed by SELECT while you are marking files to 
 help you to conform to this limit. 
 The parentheses or brackets enclosing the file name(s) can appear 
 anywhere within the command; SELECT assumes that the first set of 
 parentheses or brackets it finds is the one containing the list of files 
 from which you wish to make your selection. 
 When you use SELECT on an HPFS drive, you must quote any file names 
 inside the parentheses which contain whitespace or special characters. 
  See File Names for additional details.  For example, to copy selected 
 files from the "Program Files" directory to the E:\SAVE directory: 

 
         [c:\] select copy ("Program Files\*.*") e:\save\
 
 
 File names passed to the command will be quoted automatically if they 
 contain whitespace or special characters. 
 The list of files from which you wish to select can be further refined by 
 using date, time, size, and file exclusion ranges.  The range(s) must be 
 placed immediately after the word SELECT.  If the command is an internal 
 command that supports ranges, an independent range can also be used in 
 the command itself. 
 You cannot use command grouping to make SELECT execute several commands, 
 because SELECT will assume that the parentheses are marking the list of 
 files from which to select, and will display an error message or give 
 incorrect results if you try to use parentheses for command grouping 
 instead.  (You can use a SELECT command inside command grouping 
 parentheses, you just can't use command grouping to specify a group of 
 commands for SELECT to execute.) 
 Advanced Topics 
 If you don't specify a command, the selected filename(s) will become the 
 command.  For example, this command defines an alias called UTILS that 
 selects from the executable files in the directory C:\UTIL, and then 
 executes them in the order marked: 

 
         [c:\] alias utils select (c:\util\*.com;*.exe;*.btm;*.bat)
 
 
 If you want to use filename completion to enter the filenames inside the 
 parentheses, type a space after the opening parenthesis.  Otherwise, the 
 command-line editor will treat the open parenthesis as the first 
 character of the filename. 
 With the /I option, you can select files based on their descriptions. 
  SELECT will display files if their description matches the text after 
 the /I switch.  The search is not case sensitive.  You can use wildcards 
 and extended wildcards as part of the text. 
 When sorting file names and extensions for the SELECT display, CMD.EXE 
 normally assumes that sequences of digits should be sorted numerically 
 (for example, the file DRAW2 would come before DRAW03 because 2 is 
 numerically smaller than 03), rather than strictly alphabetically (where 
 DRAW2 would come second because "2" comes after "0").  You can defeat 
 this behavior and force a strict alphabetic sort with the /O:a option. 
 Options 
    /A:     (Attribute select) Select only those files that have the 
            specified attribute(s) set.  Preceding the attribute character 
            with a hyphen [-] will select files that do not have that 
            attribute set.  The colon [:] after /A is optional.  The 
            attributes are: 
            
               R  Read-only 
               H  Hidden 
               S  System 
               D  Subdirectory 
               A  Archive 
            
            If no attributes are listed at all (e.g., SELECT /A ...), 
            SELECT will display all files and subdirectories including 
            hidden and system files. If attributes are combined, all the 
            specified attributes must match for a file to be included in 
            the listing.  For example, /A:RHS will display only those 
            files with all three attributes set. 
            
    /D:     (Disable color coding) Temporarily turn off directory color 
            coding within SELECT. 
            
    /E      (use upper case) Display filenames upper case; also see SETDOS 
            /U and the UpperCase directive in CMD.INI. 
            
    /H      (Hide dots) Suppress the display of the "." and ".." 
            directories. 
            
    /I      (match descriptions) Display filenames by matching text in 
            their descriptions.  The text can include wildcards and 
            extended wildcards.  The search text must be enclosed in 
            quotation marks.  You can select all filenames that have a 
            description with /I"[?]*", or all filenames that do not have a 
            description with /I"[]". 
            
    /J      (Justify names) Justify (align) filename extensions and 
            display them in the traditional format. 
            
    /L      (Lower case) Display file and directory names in lower case; 
            also see SETDOS /U and the UpperCase directive in CMD.INI. 
            
    /O:     (Order) Set the sort order for the files.  The order can be 
            any combination of the following options: 
            
               -  Reverse the sort order for the next option. 
               a  Sort in ASCII order, not numerically, when there are 
            digits in the name. 
               d  Sort by date and time (oldest first); for HPFS drives 
            also see /T. 
               e  Sort by extension. 
               g  Group subdirectories first, then files. 
               i  Sort by file description. 
               n  Sort by filename (this is the default). 
               r  Reverse the sort order for all options. 
               s  Sort by size. 
               u  Unsorted. 
            
    /T:     (Time display) Specify which of the date and time fields on an 
            HPFS drive should be displayed and used for sorting: 
            
               a  last access date and time 
               c  creation date and time 
               w  last write date and time (default) 
            
    /Z:     Display HPFS filenames in the traditional FAT format, with the 
            filename at the left and the description at the right. Long 
            names will be truncated to 12 characters; if the name is 
            longer than 12 characters, it will be followed by a right 
            arrow [>] to show that one or more characters have been 
            truncated. 
 

Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs