ZTree.com  | ZEN  | About...  

 Index   Back

[Help!] Calling a batch file from ZTreeMenu   [Help!]

By: Bob Selby       
Date: Jul 10,2023 at 17:56

I have a menu entry :-

@echo off
REM Make batch file of tagged files and rename searchable ones to "* [searchable].*"
REM #ZTTag #ZTTemp\~ZTTag.bat -f"#ZTHOME\#ZTTOOLS\PDFTOOLS\test.bat" "%1" test.xyz
Call #ZTTemp\~ZTTag.bat

and the batch file simply renames the tagged files based on file size :-

@echo off
setlocal EnableExtensions DisableDelayedExpansion
del %2
C:\ZTWin\Tools\pdftools\pdftotext.exe -nopgbrk %1 %2
set size=%~z2
if %size% EQU 0 ren %1 "%~n1 [NOT SEARCHABLE]%~x1"
if %size% GTR 0 ren %1 "%~n1 [SEARCHABLE]%~x1"
del %2

But instead of processing all the tagged files it only processes the first and I cannot for the life of me see why ...

Probably my fault.
Can anyone spot my error ??

I've never had a problem before but I have always called a program and not a batch file - is this the problem ?? If so is there a way around it ??



Messages in this Thread

96,456 Postings in 12,197 Threads, 350 registered users, 119 users online (0 registered, 119 guests)
Index | Admin contact |   Forum Time: Sep 30, 2023 - 7:19 am UTC  |  Hits:58,245,960  (10,707 Today )
RSS Feed