ZTree.com  | ZEN  | About...  

 Index   Back

F9 ztreemenu, console commands,zlist.zls, here is the whole script   [Wish]

By: Ryan       
Date: Feb 09,2017 at 03:01
In Response to: F9 ztreemenu, console commands,zlist.zls can do.. i think (Bob Epstein)

there is also DIR spec you can change a liitle bit of console commands to get there, it only shows and logs the matching directory names in ztree and it is faster and more directive than anything you can think of from other file utilities.

ok if this was the one you were looking for, here is the whole working script of mine. you can import it to the ztreemenu and try it.

you see, ztree's global function only shows the matching files, but this script logs the directories you wanted and unlogs everything else... because you programmed it that way... it is so smart.

this script's credit goes to many people here


:: FILE SPEC : Find DIR's for the matching FILESPEC (writes to ZLIST.ZLS)
::Find DIR's that have the matching FILESPEC
REM *********************************************************************
IF NOT "%OS%"=="Windows_NT" GOTO :EOF
REM *********************************************************************

REM #ZTSet FSPEC Input filespec like (UFO,UFO*,*UFO*,*.UFO):
IF "%FSPEC%"=="" GOTO :EOF

REM *********************************************************************
SET ZLS=#ZTHome\ZLIST.ZLS
SET ZTW=#ZThome\ZTW.EXE /M /Y
REM *********************************************************************

TYPE NUL > %ZLS%

FOR /F "TOKENS=*" %%%V IN ('DIR ^"%FSPEC%^" /A-D /S /B') DO (
ECHO T="%%%~fV">>%ZLS%
)
REM finds the matching string like *UFO* , saves them in ZLIST.ZLS

FOR /F "TOKENS=*" %%%V IN ('TYPE %ZLS% ^| FIND ":" /C') DO (
SET CC=%%%V
)
REM counts ":" the number in ZLIST.ZLS

REM ----------------------------------------
ECHO.
ECHO NOTE:
ECHO The command shell is not unicode compatible, a word like "Fran‡ais"
ECHO can't be normally done, if so, use #ZTTag -CA, or ZTW v1.74.
ECHO ZTW v1.74 input is OEM.
ECHO ZTW v2.xx input is ANSI.
ECHO It auto-creates the C:\ZTREE\ZLIST.ZLS and has all the matching strings
ECHO.
ECHO.
IF %CC% LEQ 1 ECHO %CC% matching file with %FSPEC% spec was found.
IF %CC% GEQ 2 ECHO %CC% matching files with %FSPEC% spec were found.
ECHO.
ECHO.

REM ----------------------------------------

FIND /I "T=" %ZLS% > NUL

IF ERRORLEVEL 1 (
GOTO END
) ELSE (
START %ZTW% "/K,CTRL_Z,RET,f,QUOTE,%FSPEC%,QUOTE,RET,HOME,SH_DOWN"
)

REM CTRL_Z,RET because C:\ZTREE\ZLIST.ZLS is a default
REM

REM ----------------------------------------
:END
PAUSE
REM REM #ZTExit

1,233 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 79 users online (1 registered, 78 guests)
Index | Admin contact |   Forum Time: Mar 28, 2024 - 10:56 pm UTC  |  Hits:62,383,262  (35,659 Today )
RSS Feed