ZTree.com  | ZEN  | About...  

 Index   Back

[Tip] Example of a generic ZTreeWin batch file launcher   [Tip]

By: Slobodan Vujnovic   Homepage   France  
Date: Feb 01,2019 at 08:54

Continuing from:
http://www.ztw3.com/forum/forum_entry.php?id=122055

here is a Z.BAT files that I keep on my USB keys and systems.
It tries to locate ZTree on various drives and then launch
the 32- or the 64-bit version. This line is key:

IF EXIST "%ProgramFiles(x86)%" SET Bits=64

-----------------------------------------------------
@ECHO OFF
::@ECHO ON
:: Z.BAT -- Runs ZTWnn.EXE from the first location found in: x:\ZTW
:: Author: S. Vujnovic
:: 20040119 Creation of Z.BAT
:: 20100219 Removed for loop
:: 20100914 Allow "Z ." to use currentdrive:\ZTW
::
SET Bits=
IF EXIST "%ProgramFiles(x86)%" SET Bits=64
set d=
IF "%1"=="." GOTO RUN
@echo Searching for ZTree on C G F E D Z
set d=C:
IF EXIST %d%\ZTW\ZTW.EXE goto RUN
set d=J:
IF EXIST %d%\ZTW\ZTW.EXE goto RUN
set d=I:
IF EXIST %d%\ZTW\ZTW.EXE goto RUN
set d=H:
IF EXIST %d%\ZTW\ZTW.EXE goto RUN
set d=G:
IF EXIST %d%\ZTW\ZTW.EXE goto RUN
set d=F:
IF EXIST %d%\ZTW\ZTW.EXE goto RUN
set d=E:
IF EXIST %d%\ZTW\ZTW.EXE goto RUN
set d=D:
IF EXIST %d%\ZTW\ZTW.EXE goto RUN
set d=Z:
IF EXIST %d%\ZTW\ZTW.EXE goto RUN
@echo ZTree (?:\ZTW\ztw%Bits%.exe) not found on drives C-G and Z
GOTO EXIT
:RUN
@echo Press Enter to run: %d%\ZTW\ztw%Bits%.exe
@echo or hit ^^C to abort...
Pause > NUL
:: /ZB = enables ZAAPs
:: /Y = prevent restoring console screen upon ZTree exit (why?)
:: /TV = Display the ZTreeWin version in the console title.
start %d%\ZTW\ztw%Bits%.exe /Y /TZ /TV /ZIZTW_Slo.INI /ZCZCOLORS_Black.INI /T" [Black] %OS% %USERNAME% on %USERDOMAIN%\%COMPUTERNAME% (%LOGONSERVER%)" /ROWS:55:25 /COLS:160:120:80 /MAX /TO
:EXIT
set d=
set Bits=

165 views      
 

Messages in this Thread

 
94,242 Postings in 11,887 Threads, 347 registered users, 4 users online (0 registered, 4 guests)
Index | Admin contact |   Forum Time: Apr 26, 2019 - 2:08 am EDT  |  Hits:27,538,713  (271 Today )
RSS Feed