@echo off :: Purpose: Accept Dirspec and Filespec from user and launch :: a new ZTree session logging only matching dirs/files :: 1. The Filespec should be suitable for macro processing, :: since it is passed to ZTree with the /K switch. :: 2. The logging is based on the generated ZLIST.ZLS file. :: See the sample #ZThome\ZLIST.ZL_ file for more information. :: 3. The script is aborted if no valid Dirspec if found :: Modified: 20060118 :: :: #ZTset DIRS Enter a directory wildspec [%USERPROFILE%\My Documents]: :: #ZTset FILES Enter a ZTree filespec [*.*,COMMA,=TODAY]: SET ZLS=#ZThome\ZLIST.ZLS :: Start creating ZLIST.ZLS echo ; \\%COMPUTERNAME%\%ZLS%, created from F9 script by #ZThome\#ZTexe #ZTversion>%ZLS% echo Building %ZLS%, please wait... :: Dirspec prompt defaulted? Customize as you please... IF "%DIRS%"=="" SET DIRS=%USERPROFILE%\My Documents FOR /F "tokens=*" %%%%i IN ('dir ^"%DIRS%^" /a:d /s /b') DO @echo L="%%%%i">>%ZLS% :: Filespec prompt defaulted? Customize as you please... :: IF "%FILES%"=="" SET FILES=*.* IF "%FILES%"=="" SET FILES=*.*,COMMA,=TODAY echo F="%FILES%">>%ZLS% :: TYPE %ZLS% :: Pause :: Check if we have at least one valid F= line. If not, abort script FIND /C "L=" %ZLS% IF ERRORLEVEL 1 GOTO Error echo. echo A new ZTree session has been launched with: echo Dirspec: "%DIRS%" echo Filespec: "%FILES%" :: Customize your ZTW.EXE switches SET ZTW=#ZThome\#ZTexe /ZB /ZP /ROWS:80:66:25 /COLS:160:120:80 /Y /T" [NEW] %DIRS% %FILES%" start "" %ZTW% /KCTRL_Z,RET,f,%FILES%,RET,HOME echo. Pause GOTO Done :Error echo No new ZTree session will be launched, since no match was found for: echo Dirspec: "%DIRS%" echo. Pause :Done