ZTree.com  | ZEN  | About...  

 Index   Back

[Bug] Issue with #ZTTools-Variable in F9 Menu   [Bug]

By: Thomas Salein     Germany  
Date: Nov 27,2015 at 12:19
In Response to: [Bug] Issue with #ZTTools-Variable in F9 Menu (Ron Metzger)

> That is not my understanding. I have not seen it extend or add to PATH.
> I believe it simply gives you a configurable and somewhat dynamic
> reference to the ZTree tools directory. Use it within the F9 menus as
> appropriate to the commands issued.
>
> Try this:
> "%#ZTTools%\tfc.exe"
> etc.
>
> Thanks,
> Ron Metzger

Thank you for your answer. Yes, of course, "%#ZTTools%\tfc.exe" would find the exe, but then I could also call it via its full path. What would be the advantage of #ZTTools?

Citation from ZTW.HLP:
"%#ZTTools% - Path set by the Alt-F10 configuration option "#ZTTools path". Can be used to access commonly-used utility programs, without having to set a PATH variable for them. If not set, this defaults to the short path name of the installation directory of the currently running ZTreeWin program (ZTW.EXE)."


... and furthermore:
"G #ZTTools path: #ZTHome
Set this option to define an environment variable where F9 and other external scripts launched by ZTreeWin can locate desired support and utility programs. Environment variables may be used in the defined path."


So I understand the role of #ZTTools to extend 'virtually' or only in the environment of ZTree the PATH variable. With this I could write an entry in the F9 menu like:

pkzip25.exe -add -max -attr=all -pass %2:%3\%4 %8
to archive the highlighted file with encryption.

On my home pc ZTree like any other program would call Windows, and Windows would search for it ... yes, here it is, in a directory of the PATH.
In a foreign environment I don't know that PATH variable content, but I could bring pkzip25 with me in the #ZTTools directory.
There would be no need to enhance my F9 menu entry with the case that pkzip25.exe would not be would found, e.g. with

pkzip25.exe >NUL
if errorlevel 255 then goto FOREIGNMACHINE

:FOREIGNMACHINE
%#ZTTools%\pkzip25.exe ...


or some better workaround.

411 views      
Thread locked
 

Messages in this Thread

 
94,580 Postings in 11,930 Threads, 348 registered users, 16 users online (0 registered, 16 guests)
Index | Admin contact |   Forum Time: Nov 17, 2019 - 9:38 am EST  |  Hits:29,150,851  (10,812 Today )
RSS Feed