ZTree Application Menu Library
Community project
Visit ZTwiki for a growing collection of Application Menu samples.
Hence, no new samples will be added to this Library.



The idea for this project was born in March 2004 in the ZTree Forum.
It started in this thread and continued in: 1 2 3 4 5 6.

At the time, ZTree still supported a single menu file, ZTW_MENU.DAT. In December 2006, the name of this file changed to ZTW.ZAM. In addition, the user can now create and maintain any number of menu (.ZAM) files, adding a level of flexibility that did not exist in XTree.

ZTree's Application Menu is a very special and unique productivity mechanism, not just an add-on to the main program, that many users, sadly, ignore.

One needs to get used to the idea that it is not just (a very sophisticated) program launcher (that surpasses the Start menu in every aspect), but can also completely replace many GUI or command line tools that are used purely out of habit. For example, the Application Menu can replace a basic viewer, editor, outliner, clipboard manager, or a simple organizer. Very often, the user does not need the overhead of full-blown applications, nor can he rely on finding them on every machine he works on.

The Application Menu is ideal for migrating all BAT, CMD, and similar script files into a well-organized hierarchy of "tasks" within one or more ZAM files. Gone are the days of collections of unmanageable, often tiny, files littering the disk.

ZAM files can be packed with considerable functionality and carried around (or made available on a LAN) as part of the portable ZTree toolbox.

(The ZTree Application Menu detailed operation is described in ZTW.HLP, section 3.5.)

Project goals

This project's goal is to gather executable scripts, tips, FAQs, quick reference sheets, tables, lists, tutorials, outlines, and any other type of textual, bloat-free, content that somebody found useful to store and use as an Application Menu item.

(Yes, in addition to the executable scripts, the Application Menu deals surprisingly well with all types of static textual information!)

This repository should be used as a learning tool and a source of freely available items for building private or shared ZTree menu files.

Contributing to the Library

What can you do? You can contribute an entire ZAM, or just a single item. Thanks to several environment variables and Application Menu tokens (for example, #ZThome and #ZTtools), a very high level of portability can be achieved so your work can be easily shared with others.

As of March 2007, no new samples will be added to this Library. From now on, please use ZTwiki and its very user-friendly process for submitting Application Menu samples (and ZTree macros).

Impact on ZTree's evolution

Frequently used and increasingly complex script code, such as that for Detecting Windows versions, could be eventually provided by ZTree in the form of a single token, #ZTos, for example. Searching databases is another area that could be implemented more elegantly, via the standard ZTree View command, for example.

As we progress along this path-finding adventure, the need for new mechanisms and new #ZTdirectives may arise. It is much easier to justify ZTree Application Menu enhancements with real-life examples than simply wishing for them. This has often happened in the past.

Using the Library

Script Portability and Maintainability

Advanced Techniques and Tools

Once you start working with the Application Menu regularly, the number of scripts will tend to grow very fast. Naturally, you may decide to create a number of smaller, specialized menu files and switch between them as needed. In addition, the Application Menu-based solutions created by others are already available, making your collection increasingly difficult to manage.

You may also want to merge or remove scripts, globally search and replace, generate menu files programmatically (from applications like Excel, or even from another operating system), export to text or HTML, and so on. To make all this easy, you need Ben Kent's excellent ZTWMenuText tools. Check here for updates.

Creating and Deleting menu files

To create a new ZAM files, use F9 and the Load (F2) option and enter a non-existent ZAM file name. ZTree will offer to create it for you and default all missing parts of the filespec.

Examples: D:\test.zam, \\server\common\TODO_list.ZAM, New, Z:\junk.zam.

Delete a ZAM file as you would any other file on your disk or the LAN.

ZAM files are normally stored in #ZThome, but can be put anywhere where ZTree can reach them.

Loading menu files into the Application Menu

Loading menu files is achieved in two ways. The standard way is from the Application Menu (F9), using the Load (F2) option. Another way is simply Opening a ZAM file in the File Window. This will launch the Application Menu with the ZAM file already loaded.

Normally, a ZAM file cannot be "unloaded", rather, the user instructs ZTree to switch to another ZAM file.

To experiment with menu file switching, download these sample menu files.

Warning: If multiple ZTree instances are active, and if the Application Menus write to the same ZAM file, changes made by all ZTree instances will be merged in interesting ways into the single ZAM file. It is the changes made by the last ZTree instance to exit the Application Menu that will remain on disk.

Populating menu files with existing files

It is common to migrate .BAT and other script files to the Application Menu one by one, but this task becomes too hard when dozens or hundreds of files need to be migrated.

By using a macro, this task becomes extremely easy: in a few mintues, hundreds of text files can be migrated. After that, some item renaming, grouping and re-arranging is in place, resulting in a menu file that is perfect for you. No file system can ever offer you the flexibility of the ZTree Application Menu! Of course, not all data is appropriate for it, but it must not be considered as just a program launcher either.

For example, to migrate you poetry files, select all *.POE files in File Window and then execute the macro starting with the last file in the list. Then just press Alt+F12 to repeat the macro all the way to the first file in the list.

Hitting F9 will reveal all items created at first level. You may then create levels by authors, epochs, add comments, reviews, links, biographies, translations, and so on. Again, all those things you cannot easily do with your collection if it remains in the form of disk files.

Sharing menu files

Simply mail, upload to a web site, or place a ZAM file on a LAN server. Any ZTree user can then copy it to #ZThome and Open it for private use and modification.

Note that the Load (F2) command also supports the \\server\share\name.ZAM format, making it unnecessary to create private copies and also simplifying maintenance and security operations.

Imagine a single, company-wide Start button. Now imagine an infinite number of company-wide Start buttons! This is exactly what your ZAM files can be -- tree-like hierarchies of shortcuts to applications and documents.

Sample menu files (Updated: 20040610)

|--My menu file collection (*.ZAM files I downloaded or created)
| |--Personal, free-form menu files
| | |--
Ben Kent's menu file [DOWNLOAD] 20040426
| | |--Laurent Duchastel's menu file [DOWNLOAD] 20040610
| |--Ideas for specialized menu files (FAQs, reference, toolsets)
| | |--Windows GUI emulation (A character-cell shell)
| | |--Windows Registry (All aspects of Registry maintenance and hacking in one place)
| | |--Windows TCP/IP networking utilities, tips, configuration scripts
| | |--Windows 2003 Resource Kit tools
| | |--Sysinternals utilities with docs, examples, tutorials
| | | |--Visit Sysinternals.com
| | |--Quick Reference
| | | |--Character set table 000-127
| | | |--Character set table 128-255
| | | |--Powers of 2 and hexadecimal arithmetic
| | | |--Keyboard scancodes
| | | |--ANSI escape sequences
| | | |--DOS prompt escape sequences
| | | |--Keyboard shortcuts
| | | | |--MS Office (Word, Excel, PowerPoint, Access)
| | | | |--Explorer, Internet Explorer

Sample menu items (Updated: 20060119)

Below are random "getting-started" scripts (menu items), to give you an idea of what you can put in a menu file. The organizational and stylistic choices are also totally arbitrary.

Using the powerful and unique outlining capabilities of the Application Menu, it is extremely easy to create elaborate, hierarchical, work environments and procedures that just cannot be achieved within any other desktop metaphor.

|--Test ZTree parameter passing and directives
|--Detecting Windows versions (conditioning the scripts)
|--ZTree maintenance: backup, SOS Floppy, Forum (bugs, ZEPs)
|  |--ZTree environment searching
|  |--COPY ZTW.ZAM and ZTW.HST to A:
|  |--RENAME ZTW.EXE and COPY ZTW.HLP to ZTW_yyyymmddhhmm.*
|  |--Compare ([J]FC) highlighted with file in opposite [F8] panel
|  |--Start rpVT from within ZTree
|  |--Start a new ZTree session with /O switch (see Help)
|  |--Start a new ZTree session with customized Dirspec/Filespec 20060119
|  +--Web publishing with ZTree (The page you are reading is uploaded with this script)
|  |--Lock this computer
|  +--Screensaver
|--Directories and Files
|  |--Create zero-length file named "0length.fil" (pre-defined name)
|  +--Create zero-length file with any name (interactive)
|--Editors and Viewers
|  |--Vedit
|  |  +--Macros
|  |     |--Ian Binnie's ZAM editing script (ZtwMenu2txt.vdm) 20070308
|  |     |  +--More scripts and tools from Ian
|  |     +--Invoke Vedit Wildfile macro for Tagged Files 20040628
|  |--NoteTab
|  +--Jim Wilson's V3 viewer
|     +--Open %7 (short file name)
|--Computer Management
|  |--Encryption, security
|  |  |--Create MD5 file with FSUM, RAR folder, delete files
|  |  |--Clear all "My Documents" links with secure erase
|  |  |--Secure erase tagged files (requires 4DOS/4NT)
|  |  +--Disable/Enable Hosts blocking file 20040727
|  |--Norton AntiVirus
|     |--Scan current file
|     |--Scan current directory
|     |--Live Update
|     +--Download
|--Archivers, Compressors: ZIP, ARJ, LHA, LZEXE, EXPAND, ARC, ZOO, RAR, GNU, UPX
|  +--GUNZIP ? (only does a SINGLE file and DESTROYS originals)
|  |  +--GUNZIP *  compress and REPLACE ALL files with their *.gz, CURRENT DIR ONLY
|  |  +--                           ""                             RECURSE INTO DIRS
|  |  +--GUNZIP %1 compress and REPLACE file.ext with file.ext.gz
|  |--TAR 1.11.2 ? (GNU tar, understands GZIP/GUNZIP)
|  |  +--Download
|  |--RAR
|  |  |--Extract in subdir, NO prompting, external cmd session
|  |  |--Compress a folder, solid, max compression, testing, and DELETE files
|  |  +--Download
|  |--UPX, compresses .EXEs and .DLLs
|  |  |--Compress (UPX) %1 20040708
|  |  |--Compress (UPX) %1, enhanced 20040714
|  |  |--Compress (UPX) %1 (requires 4NT) 20040708
|  |  +--Download
|     |--Test zipfile and password (if it exists)
|     |--PKZIPC
|     |  +--Register or Unregister PKZIPC on current computer
|     |--PKZIPFIX %1  Fixes corrupt .ZIPs
|     |--Extract ALL *.ZIP in current dir, NO prompting
|     +--Set zipdate to newest
|--Network drives (all NET USE commands in one place)
|  |--Work machines
|  |  |--Linux servers (Samba)
|  |  |--Windows servers and workstations
|  |  |--OpenVMS servers (PATHWORKS 32)
|  |  +--Tru64 Unix servers
|  +--Home LAN
|     |--OpenVMS servers
|     |  +--VAX (DECnet and TCPIP)
|     |     +--ping this machine
|     |  +--Alpha (TCPIP only)
|     |     +--ping this machine
|     |--Map network drives in home LAN
|     +--Map kids computer drive C: to K:
|           +--NET SEND a message to kids
|  |--IrfanView
|  |--Terminal Server Client (Remote Desktop) sessions
|  |--KEA! Terminal Emulation
|  |--CD burning with command line tools (mkisofs, cdrecord)
|  +--Audio extraction (EAC)
   +--Include examples from: http://www.ztw3.com/forum/forum_entry.php?id=3842

Updated: 20120810
Copyright 2007 vujnovic@free.fr. All rights reserved.