Code:
DIR /B /A:d %TYPE%\*%2* > D:\TEMP\LIST.TXT
SELECT /O:u GOSUB LAUNCH %TYPE (@D:\TEMP\LIST.TXT)
I am in the process of writing a batch file and I have the above two lines as a part of it. The select line does not seem to be operating as expected. I've been unable to find out if I've got a simple typo that I'm not seeing or if this is a bug in TCC26 (the version I'm on currently).
Prior to this code %TYPE is set to one of two sub-directories in full path format starting with the drive letter, which in both cases is Z:\. There is no white space in %TYPE requiring quoting. The second argument to the batch file is to be a search term for a sub-directory within %TYPE. The first line creates D:\TEMP\LIST.TXT which contains all sub-directories within %TYPE that match the search term. In reviewing the file, it is the full path format of the found sub-directories. There are no quotes around these paths. In my case most of them have white space in the final level directory, or the found part.
The second line enters the select screen with the sub-directories in LIST.TXT as options to select. They are listed without their path. After selecting the particular sub-directories wanted, this passes the first argument the value of %TYPE to the subroutine LAUNCH. I would expect that the second argument passed would be one of the selected sub-directories with out their path. If, for example, I were to select the sub-directory DOE, James (123-456-789), I would expect that to be the second argument passed to LAUNCH. However, I am getting "@D:\TEMP\DOE, James (123-456-789)" with the quotes. It is like the contents within the brackets in the second line are passed after replacing LIST.TXT with the name of the selected sub-directory and putting the whole thing within quotes.
I need to give the full path of LIST.TXT because the batch file is being run with the current directory down the tree on W:\ and once deployed will be on C:\ in a directory to which the user running it will not have write priveledges. I cannot use simply the current directory in this unless I do a PUSHD/POPD to change to D:\TEMP for part of the duration of the batch file's execution.