home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR2
/
DOSMN41B.ZIP
/
DOSMENU.DOC
< prev
next >
Wrap
Text File
|
1993-10-28
|
65KB
|
1,717 lines
DOSmenu
(C)Copyright 1993
by
Skip Bremer
Version 4.1
10/25/93
TABLE OF CONTENTS
==============================================================================
Topic Section
----- -------
Introduction ...................................................... 1
Miscellaneous ..................................................... 2
Requirements
Recommendations
Limits
Start-Up Options
Required Files
Optional Files
Quick Start ....................................................... 3
Start-Up Batch File ............................................... 4
Commands .......................................................... 5
DMUtil Utility Program ............................................ 6
Command Parameters
The Menu File Editor
DMQuery Batch Input Utility ....................................... 7
Setup ............................................................. 8
Initial Menu Creation
Menu Configuration
Noticing .......................................................... 9
Menu Definition ................................................... 10
Server-Based Convention
Rules-Based Convention
Notes
Testing Your Menu
Menu Rules ........................................................ 11
Rules
Notes
Loading Additional Menus
Sub-Menus ......................................................... 12
Compiling Menu Files .............................................. 13
Translating Menu Files ............................................ 14
Temporary Batch Files ............................................. 15
DOS Environment Variables ......................................... 16
Examples .......................................................... 17
Init File
Menu File
Credits ........................................................... 18
Version Updates ................................................... 19
Shareware ......................................................... 20
Evaluation Copy
Distribution
Registration
Disclaimer
INTRODUCTION (1)
==============================================================================
DOSmenu was designed as a simple yet powerful menu system for both network and
DOS stand-alone environments. We work in an environment that demands an
easily changeable, concise menu system to help us provide proper support for a
large Netware 386 (tm) wide area network domain spanning Texas. The menu
system we needed had to be both easy to use and very flexible and yet it had
to stay out of the way as much as possible for our user operations. Quite
simply, we couldn't find one, so we wrote our own. We hope it helps you as
much as it has helped us in controlling our environment. Please use DOSmenu
as you see fit, but if you continue to use it, please abide with the Shareware
section of this documentation.
Here is a quick overview of DOSmenu:
o Small executable size.
o Unlimited number of menus.
o No memory taken by the menu system when running commands.
o Run anything from the menu system including Terminate and Stay Resident
programs (TSRs).
o Many options to determine whether menu item is usable by a user such as
user name(s), server name(s), node address(s), member of group(s),
directory(s) available, file(s) available, password, and combinations of
all of them.
o Automatically knows Netware users, groups, servers and connection
numbers. Substitutes are easily defined on other networks and
stand-alone environments when necessary.
o All switches/options and menus and their associated commands may be
changed on-the-fly while users are using the menu system. They will all
take effect after the next command run by each user.
o Optional compilation of menu files provides ultimate menu security.
o Can translate netware menu files.
o Full mouse support with registered version.
DOSmenu was written in Turbo Pascal 7.0 (real mode) with assembly extensions.
MISCELLANEOUS (2)
==============================================================================
Requirements
------------
DOSmenu's only known requirement is that it must run under DOS 3.1 or higher.
It runs fine from a Windows DOS session and from DOS shells.
Recommendations
---------------
Consider placing the command
SHELL=C:\COMMAND.COM /E:512 /P {or more}
in all CONFIG.SYS files using this menu system. Although not required, if
DOSmenu cannot find enough DOS environment variable space to write a menu
command to a DOS variable, then it will not be able to run the command.
Typically this involves only a few bytes, but it could take up to 80 bytes of
environment space for the local machine running the system, depending on the
associated command(s) for menu items. See the DOS Environment Variables
section for a discussion on the use of DOS variables.
Limits
------
Maximum menu files: unlimited
Maximum menus per menu file: 20 (or less, depending on memory available)
Maximum entries per menu: 20
Maximum DOS commands per menu item: 10
Maximum rights per menu item: 10
Maximum items per right: 10
Maximum length of menu items : 50
Maximum length of menu rights : 80
Maximum length of menu commands: 80
Maximum length of help lines: 61
Maximum question length: 50
Maximum active notices per user: 15
Maximum number of lines per notice: 10
Maximum length of notice lines: 70
Start-Up Options
----------------
DOSmenu is started with the command DOSMENU in a batch file. However, within
this batch file, you may specify a user ID, a server name and/or a node
address on the DOSmenu command line (after /BATCH). Normally this is not
necessary because DOSmenu picks the user ID and server name up automatically
on Netware networks and you may define DOS variables to be used within the
DOSmenu init file which will then be used to determine the active user and
active server on stand-alone environments. See the Setup section for complete
information on this subject.
Required Files
--------------
The following files are necessary to run DOSmenu:
DOSMENU.EXE The DOSmenu program.
DMUTIL.EXE The DOSmenu utility program. Used to generate, edit, compile
and decompile menu files.
DOSMENU.INI The default DOSmenu init file initially generated and edited
with DMUtil. This file is used to configure your menu system
environment.
DOSMENU.MNU The default DOSmenu menu file initially generated and edited
with DMUtil. This file is your menu.
MENU.BAT The start-up batch file initially generated and edited with
DMUtil. This file may be called any name you wish.
Optional Files
--------------
DOSMENU.NTE The default DOSmenu note file initially generated and edited
with DMUtil. This file holds user notices. You can edit this
file any time you wish because it is dynamic from the users'
standpoint.
DMQUERY.EXE An external utility that gets and uses batch file input. See
the DMQuery section for more.
NOBRK.* This very useful utility can help to guarantee security within
your menu system with an approach that is different than the
inherent DOSmenu {r=nobreak} rights option. See Menu
Definition for more on this right and NOBRK.ZIP for more on the
NOBRK utility.
Many additional utility programs and full mouse support are shipped with the
registered version.
QUICK START (3)
==============================================================================
To quickly get the menu system up and running, do the following (check the
documentation later for specifics):
o Copy all DOSmenu files to a permanent home directory
o Change to that home directory
o Run 'DMUTIL /G' to generate the default menu files
o Run 'DMUTIL /I' to setup the menu environment
o Run 'DMUTIL /M' to setup specific menu items
o Run 'DMUTIL /N' to setup specific user notices -optional
o Run 'DMUTIL /C' to compile the menu file -optional
o Move MENU.BAT to a directory in your users' path
o Run 'MENU' to start the menu system
START-UP BATCH FILE (4)
==============================================================================
As part of the initial file generation performed by DMUtil, the file MENU.BAT
will be made in DOSmenu's home directory. MENU.BAT must be in your users'
path, but DOSMENU.EXE should remain in its home directory, where this batch
file will look for it. All users must be able to 'read' this directory.
DOSMENU.INI, DOSMENU.MNU and DOSMENU.NTE must always be in the same directory
as DOSMENU.EXE.
Here is a commented MENU.BAT:
@echo off ;Cosmetics only
::this batch file must be in users' path
f:\login\dosmenu /batch %1 %2 %3 %4 ;Point to and run DOSmenu {with parameters
; if desired (not required on Netware)
; and optionally enter a menu file name
::quitting the menu system? ;255 is passed when quitting is ok
if errorlevel 255 goto END ;If so, then leave loop and batch file
::call variable set by dosmenu ;Otherwise, run the selected command or
%_dosmenu% ; batch file passed by DOSmenu
::do it again ;Keep running the batch file (and the menu
menu %1 %2 %3 %4 /rerun ; system) and until the system is stopped
:END ;Place to go to when quitting
Do not change the %_dosmenu% line! It is discussed under the Menu Rules
section.
Parameters are normally only needed if you are not running on Netware and have
not set the names of the user ID variable and server name variable to be used
by DOSmenu in the menu file and you are not running in a stand-alone
environment.
The DOS variable _dosmenu is loaded with either the actual menu command (if
there was only one) or the temporary batch file path and name made by DOSmenu
when it combined the commands for the selected menu item.
Quitting will move to the end of the batch file, thereby stopping the system.
You can place a quit command on your user's menu to do the same thing by
defining the actual DOS command for that menu item to be 'goto END'.
COMMANDS (5)
==============================================================================
DOSmenu has very few commands. All users are required to do is point and
shoot. There are a couple of commands, however, that at times may be
worthwhile.
F1 HELP DOSmenu contains context sensitive help. Press it anytime.
F2 DOS This key will allow a user to perform any DOS command from
within the confines of the menu system. You may password
protext this command from within the init file. See the Setup
section for complete information on this subject.
F3 VIEW This key will always view the current DOS screen. This is
useful after running a command that puts information that you
need to see on the DOS screen.
F9 NOTICES This allows the users to review any notices that were directed
at them, and any new notice that may have been added since
the last time they accessed the note file.
F10 QUIT This key will quit DOSmenu (and quit the start-up batch file by
passing a 255 errorlevel). You may password protext this
command from within the init file. See the Setup section for
complete information on this subject.
ESC PREVIOUS Anytime a user is in a sub-menu, pressing Esc will back them
up to the previous menu. This key forces the screen saver at
the main menu. Esc also backs users out of prompts such as the
command parameter prompt, if necessary.
MOUSE (registered version only) Normally, the left mouse button
simulates the Enter key and the right mouse button simulates
the Esc key. However, you may also use the mouse to manipulate
the scroll bars, point directly to menu items and then click on
them to run them.
DMUTIL UTILITY PROGRAM (6)
==============================================================================
COMMAND PARAMETERS
==================
The DMUtil program is designed to keep all of your menu maintenance
requirements in one utility. Anything that you need to do to your menu system
can be done with DMUtil.
Here is the command syntax:
DMUTIL /G|M|I|N|C|D|E|T [[PATH]FILENAME]
where:
/G = Generate the default DOSmenu batch, menu, init, and note files
(discussed throughout the documentation)
/B = Edit the DOSmenu start-up Batch file (MENU.BAT)
(provides specific help for editing the start-up batch file)
/I|M|N = Edit the DOSmenu Init|Menu|Note file (DOSMENU.INI|MNU|NTE)
(provides specific help for editing the specific file type)
/C|D = Compile|Decompile the DOSmenu init, menu, or note file
(discussed in Compiling Menu Files section)
/E = Edit any text file less than 64K in size
(for convenience only)
/T = Translate netware menu files
(discussed under Translating Menu Files section)
/B always defaults to MENU.BAT while /M|C|D always default to DOSMENU.MNU.
/E|T require a filename while a filename is optional for /B|I|M|N|C|D.
After you have compiled a menu, init, or note file, then when editing one of
those files with DMUTIL /M|I|N, DMUtil will automatically decompile - edit -
recompile the file for you.
THE MENU FILE EDITOR
====================
The editor is a simple ascii text editor that has specific help screens
depending on the menu file-type you are editing to give you some on-line help
about that type of file. In actuality, any ascii editor can be used to edit
the start-up batch, init, menu and note files.
Here are the internal editor commands by keys:
Normal Function Keys
--------------------
F1 ?HELP Specific menu file-type help.
F2 SAVE Saves the file being edited and continues editing. (^KS)
F3 CUTB≈L Cut either the current line or the current block (if a block is
highlighted) for later pasting.
F4 PUTB≈L Pastes the last line or block that was cut (once).
F5 COPYB Copies the marked block to the cursor position. (^KC)
F6 MOVEB Moves the marked block to the cursor position. (^KV)
F7 BEGINB Defines the beginning of a block. (^KB)
F8 ENDB Defines the end of a block. (^KK)
F9 HIDEB Toggles showing and hiding of a marked block. (^KH)
F10 QUIT Quits editing.
Alternate Function Keys
-----------------------
F1 EHELP Basic editor help.
F2 PRTB≈F Prints the highlighted block or the entire file to LPT 1, 2 or
3. (^KP)
F3 DELB≈L Deletes the current block or line. (^KY)
F5 WRITEB Writes the current block to a file. (^KW)
F6 READB Reads a file into a block. (^KR)
F10 DISPLAY Shows all file parts separate from non-file parts. A great way
to find extra spaces at the end of lines. Also toggles between
showing actual control characters and an easier-to-identify
representation of them. (^OD)
Miscellaneous Keys
------------------
Ins Toggles insert/overtype modes. (^V)
Del Deletes character at the cursor. (^G)
^T Deletes word.
^BkSp Deletes word left. (^H)
^Y Deletes current line.
^QY Deletes line right. (AltK)
^QL Restores current line. (^U)
^OI Toggles auto indent mode.
^P Enters a control character with the next character typed. To
enter an Escape character, press ^P and then Escape.
^QF Finds case insensitive. (^Z)
^QA Finds and replaces. The replace string case sensitive. (^A)
^L Does the next find or replace. (AltZ or ShiftTab)
Note
----
Although the editor has blocking, it is only line oriented.
DMQUERY BATCH INPUT PROGRAM (7)
==============================================================================
DMQuery is a utility that can be used to provide input for batch files made
with DOSmenu.
Here are the command line parameters:
DMQUERY N [/R|U|E|Danswer]
where
N = A number from 1..9
/R = Input is required (an answer must be given)
/U = Input will be forced to upper case
/E = Input will be echoed to the screen afterwards
/Danswer = Input default answer will be ''answer'' (must be one word only)
The DOS variable '@N' is temporarily used. DMQuery may be run from DOS or a
DOS shell; however, it must be queried for and acted upon within the _same_
batch file, like this:
@echo off');
echo What is your name? {your question};
dmquery 1 /r/e /dJoe {answer required, put in var @1, def=Joe};
if errorlevel 255 goto.. {not enough env space? -optional}
echo %@1% {use answer variable @1 as you wish!}
Here is an example DOSmenu menu item:
;-----
Directory
echo Directory of what?
dmquery 1
echo Switches (/w, /p, etc)?
dmquery 2
dir %@1% %@2%
pause
;-----
SETUP (8)
==============================================================================
DOSmenu has two setup phases, the initial default file creation and the
editing of those files.
INITIAL MENU CREATION
=====================
After moving all DOSmenu files to a permanent home directory, and then moving
to that directory, you must run DMUTIL /G to generate the initial menu file
set consisting of DOSMENU.INI (the init file), DOSMENU.MNU (the menu file
shell), DOSMENU.NTE (the note file) and MENU.BAT (the start-up batch).
DOSmenu must run from a batch file for the reasons discussed below. We will
use the name MENU.BAT throughout this documentation, however it may be named
anything you like as long as it ends in .BAT.
MENU CONFIGURATION
==================
After DOSMENU.INI is created, you need to edit it in order to set the
environment to your specific system. You should edit this file with DMUTIL
/I to get specific help about this file's options. (Then you will need to
edit DOSMENU.MNU to make the actual menu(s)). The init file contains various
options and switches that control how DOSmenu will work for you or your users.
These are discussed here.
Use Mouse=
----------
Default=yes. With the registered version, you may optionally use your mouse
to manipulate your menu. A mouse driver (like MOUSE.COM) must be loaded on
the work station to enable mouse support.
Using Netware=
--------------
Default=yes. This switch tells DOSmenu whether it should make Netware API
calls to determine the actual user and server in force when it is running.
These two pieces of information can be overridden by you whenever you wish by
one of the following methods:
Set DOS variables equal to the current network user and file server.
This option is desired when running on non-Netware networks. For
instance, if you set the DOS variable USER to the actual user ID in the
network start-up script, then it will be found and used by DOSmenu if you
enter USER as the user DOS variable with the option below.
Non-Netware DOS User Var=uname
Non-Netware DOS Server Var=sname
Or you may place them directly in the batch file, like
[path]dosmenu /batch /u:%uname% /s:%sname%
or type them when running the batch file, like
menu /u:uname /s:sname
The priority DOSmenu uses to obtain this information is as follows:
1. Actual Netware information if Netware=yes and on a Novell network.
2. Already set DOS variables (this will override 1.).
3. Command line parameters (this will override both 1. and 2.).
Non-Netware DOS User Var=
-------------------------
Default={nothing}. As discussed above, this option allows DOSmenu to find the
user ID for the person running the menu system when not on a Netware network
(or when you decide to override the API method).
Non-Netware DOS Server Var=
---------------------------
Default={nothing}. As discussed above, this option allows DOSmenu to find the
server name for the person running the menu system when not on a Netware
network (or when you decide to override the API method).
Any-Network DOS Node Var=
-------------------------
Default={nothing}. This option allows DOSmenu to use the work station network
node address as a determinant as to whether a menu item will be available or
not (See Menu Definition section to learn how this is done). You may format
the node address anyway you wish, as long as your network start-up script for
each user uses the same format.
Private Directory=
------------------
Default=c:\. DOSmenu will write an on-the-fly batch file for running menu
commands embedded within the menu file ONLY when there is more than one
command for the chosen menu item. When this happens, it is important that
this batch file be written to an area within the user's network environment
where that user has actual 'write' rights, else the batch file cannot be
written.
Typically, on most networks, a 'private' area is mapped for each user on
start-up that is their personal mapped drive (actually just a network
directory based on the user's ID) on the server. In such a case, you should
place that location here. An example might be H:\ if you had mapped
F:\USERS\%LOGIN_NAME to H:\ (on a Novell network). If no such directory is
mapped or used on your network, then we suggest using C:\, which should always
be private to the user for every session.
If you would rather have all users write their on-the-fly batch files (when
necessary) to the same location, that is ok as long as you are on a Novell
network because DOSmenu also knows and uses the actual user connection number
as part of the batch file name, e.g., @DMBAT4.BAT, where this user is using
connection number 4. In this case, simply define the Private Directory as any
place on the network where all users have 'write' rights.
Remember, this batch file is only written if more than one DOS command is
defined as part of a chosen menu item. If all of your menu items call
already-created batch files or actual DOS EXE, COM, or BAT programs, then the
Private Directory option will never be used by DOSmenu.
You may actually specify two private locations for this option, like
Private Directory=h:\,c:\
to help take care of special cases like when a user does not have the proper
network mappings.
On a stand-alone environment, you do not need to define a Private Directory.
And in that case, any temporary batch files will be written to DOSMENU.EXE's
home directory.
Support Comment=
----------------
Default=For HELP Please Call Computer Support. This phrase will be shown at
the bottom of the main help window in blinking fashion so that your users will
easily know what to do in case they need help. We recommend placing the
support telephone number with this phrase.
Desktop Color=
--------------
Default=71(for color machines) or 70(for monochrome machines). This number
determines the color of the menu system's desktop background. The first
number represents the standard MS-DOS foreground color code, and the second
number represents the standard MS-DOS background color code. If you enter
only one color, then it will represent the background color and the
foreground color will be 0. Entering nothing or 0 or 00 will disable the
desktop background. For example:
71 = white fore on blue back
70 = white fore ob black back
7 = black fore on white back
0 = no desktop background
The standard MS-DOS colors are:
0=black
1=blue
2=green
3=cyan
4=red
5=magenta
6=brown
7=white
Both the foreground and background numbers are limited to a range between 0
and 7.
Screen Saver Time=
------------------
Default=5. The default means that after 5 minutes of keyboard inactivity, the
screen saver will become active. This is only true if the quit time
(discussed below) does not approach first. The screen saver simply slides a
soft information line around a blank screen showing the date and time, the
user ID, and the time remaining before an automatic menu quit (if defined).
Enter nothing or 0 to disable the screen saver, else enter the number of
minutes before screen saver activity commences.
F2 Run DOS Password=
--------------------
Default={nothing}. If filled in, then DOSmenu will require this password
before allowing users will have the option of composing and running their own
DOS command, just as they would at the DOS prompt. This may be considered a
security/safety issue within your environment. If so, place a password here
and later compile the DOSMENU.INI file with DMUTIL /C DOSMENU.INI.
When F2 is pressed, an answer box will pop up asking the user for the DOS
command to be run. If nothing is entered then the command is ignored. Also
for safety reasons, if a user enters a command that has the word 'command'
anywhere within it, then it will also be ignored. This is to prevent a user
from actual going to DOS by loading another copy of COMMAND.COM.
F10 Quit Menu Password=
-----------------------
Default={nothing}. If filled in, then DOSmenu will require this password
before allowing users to quit the menu system. This may be considered a
security/safety issue within your environment. If so, place a password here
and later compile the DOSMENU.INI file with DMUTIL /C DOSMENU.INI.
If no password is defined, then the user will be prompted to be sure they wish
to quit the menu system.
Timed Quit Menu Time=
---------------------
Default=0. This option, if enabled, allows you to control your user's allowed
time of inactivity before forcing them off of the network (or simply out of
the menu system). On our, network, connections are at a premium, and
therefore we use this option to remove users from the network after 30 minutes
of no activity on their part. We do this by entering the command 'logout' for
the Quit Menu Command (discussed below). Entering 0 or nothing disables this
function, else enter the number of minutes before automatic menu quit.
Timed Quit Menu Command=
------------------------
Default=logout. If automatic quitting is enabled via the option above, then
what ever is placed in this option will be run when the automatic quit is
invoked. Obviously entering 'logout' will log the user out of the network.
If you simply wanted to remove a user from the menu system at automatic quit,
then enter 'goto end' here. This in affect will take the user out of the
MENU.BAT internal loop that normally keeps DOSmenu going. Entering nothing
here essentially disables your automatic quit system as well because DOSmenu
will issue no command and, instead, the menu will run again via the loop in
the MENU.BAT file.
After defining the above switches/options, you are ready to set up
DOSMENU.MNU which contains the actual menus that will be used by the menu
system. Please see the Menu Definition section for specifics on that task.
NOTICING (9)
==============================================================================
The file DOSMENU.NTE is used to leave notices to any and all users
-dynamically. Here you may place notices based on the rights defined for each
notice (See Menu Definition section below for rights specifics). Each notice
consists of at least two lines; line 1 contains the rights and the following
lines (up to 10) contain the actual notice, like:
;-----
{g=paradox} {s=server1}
Paradox will be down on SERVER1 all day today.
Hopefully it will be up tomorrow...
;-----
Here, only users in group PARADOX on server SERVER1 will get this notice when
they next start up the menu system.
Each user may have up to 15 active notices in the file at one time. Each
notice may have up to 10 lines, and each line may be up to 70 characters long.
You can add and subtract from this section anytime throughout the day. When
a user starts the menu system, the notices are checked and shown, if
appropriate. Additionally, each time a user runs a menu command, the
DOSMENU.NTE file time is checked, and if it is later than the last time the
user saw the notices, they will se them again. This gives the noticing
system a dynamic quality that can be very useful to you as an administrator!
(The time of the file when the user reads notices is kept in a DOS variable
called _DMNTE. This variable is checked each time a user reloads the menu
system after running a command. If you have made a change to the DOSMENU.NTE
file during that time, then the user will see the notices again, and the
variable will be updated.)
MENU DEFINITION (10)
==============================================================================
There are two conventions used to control the menu or menus a user gets when
running the menu system, server-based and rules-based. These conventions are
much more difficult to explain than to actually use, so we will briefly both
describe and show example code, offset with ';-----', throughout.
Comprehensive examples will be shown at the end of the section. Note that a
small example is also made for you when your first run DMUTIL /G to create the
default menu files.
SERVER-BASED CONVENTION
=======================
Approaching the DOSMENU.MNU menu file from the top down, the system can be
thought of as a server-based system. This can become quite robust, as in our
eight-server domain or quite simple, as in the case of a single server or a
stand-alone environment. Basically, the file is divided vertically into
server sections that are defined by the actual server name. An all
encompassing name is also allowed and it is called ALL. Each server name, and
the ALL choice, must start at the beginning of a line with a colon, e.g.,
:OUR_SERVER or :ALL. Although not very practical, you can have more than one
section defined with the same server name. Actually, defining an :ALL section
at the beginning and at the end can be a good idea because it allows you to
show certain all-encompassing menu items at the top and also at the bottom of
each user's menu. Here is a segment of a menu definition showing the vertical
server-based method:
;-----
%Main Menu
:ALL
Word Perfect
wp
:MAIN_SERVER
Paradox
paradox
Lotus 1-2-3
123
:SECOND_SERVER
Proprietary application
ourapp
:ALL
Logout of the network
logout
;-----
In the above example, you can see that a person who is running on the main
server would get the following main menu:
─────
Word Perfect
Paradox
Lotus 1-2-3
Logout of the network
─────
while a person running on the second server would get:
─────
Word Perfect
Proprietary application
Logout of the network
─────
Note that any menu items (and sub-menus and their items) may be accessible
depending upon which section they are placed, subject to the next convention
of discrimination, rules-based, which is discussed below.
Also note that for a stand-alone environment, you would only need to place one
:ALL line near the top of the menu file (in fact this would be required).
RULES-BASED CONVENTION
======================
A secondary, and much more powerful means of segregating the menu file between
users, is the rules-based method. Whereas the server-based convention may be
viewed as vertical, we like to think of the rules-based convention as
horizontal. In other words, after deciding which server a user is using, we
then must decide what the rights of that user are, and this convention does
just that.
There are several methods to determine and define menu rights for a user.
All but one of them are enacted by placing one or more phrases to the right of
the menu item, each enclosed in braces {}. Another is enacted by placing
nothing to the right of the menu item. Let's discuss each method in detail.
All rights assumed
------------------
Rule = enter nothing to the right of the menu item. This method is the
quickest and least secure way of checking users rights because it checks
nothing. In other words, a menu item will show up on a user's menu if it is
under the correct server name (or ALL), period. Here, you will be relying on
your defined network rights to determine whether a user will be able to run an
item or not. As an example, if the user has no rights to the Paradox
directory, then the user will not be able to run that item (although it will
still be shown on the menu). This method is, of course, exactly what you
would use if you were on a stand-alone environment.
;-----
Paradox
paradox
;-----
User gets item if it is available, period.
Directory rights
----------------
Rule = {d=directory name or d=directory name1,directory name2 ..}. Here,
instead of relying on the network to determine after the fact whether a
program can be run, you check it before hand. DOSmenu will look to see if
any of the listed directories exist for the user when it reads the menu file,
and if all of them do not, it will not place the item on the user's menu.
Obviously this is a better scenario for the user as he/she should normally be
able to run all items that are displayed.
;-----
Paradox
{f:\apps\paradox}
paradox
;-----
User gets item only if F:\APPS\PARADOX is 'visible' in the user's environment.
File rights
----------------
Rule = {d=file name or d=file name1,file name2 ..}. Here, instead of relying
on the network to determine after the fact whether a program can be run, you
check it before hand. DOSmenu will look to see if any of the listed files
exist for the user when it reads the menu file, and if all of them do not, it
will not place the item on the user's menu. Obviously this is a better
scenario for the user as he/she should normally be able to run all items that
are displayed.
;-----
Paradox
{f:\apps\paradox\paradox.exe}
paradox
;-----
User gets item only if F:\APPS\PARADOX\PARADOX.EXE is 'visible' in the user's
environment.
Server rights (Netware only unless DOS variable/command line parameters used)
-------------
Rule = {s=server_name1 or s=server_name1,server_name2 ..}. Do not confuse
this method with the server-based convention. They are not attached in any
data way. Here, by placing one or more server names beside a menu item, you
are saying only show this item when the user is logged into one of those
servers. The main use for this option is under the :ALL section(s). You may
have defined 'Logout..' as a menu item under :ALL, but you may wish for users
only on particular servers to actually have that item on their menu. This
would be a shortcut to otherwise having to place the command in each server
section on which you wish to allow the command.
;-----
Paradox
{s=main_server}
paradox
;-----
User gets item only if the user is logged into MAIN_SERVER.
Group rights (Netware only unless DOS variable/command line parameters used)
------------
Rule = {g=group_name1 or g=group_name1,group_name2 ..}. This is a more
specific method for deciding whether a user sees a menu item or not. Normally
you define groups to group certain users that you can later assign trustee
rights to, thereby giving them access to certain programs. This method allows
you to use that work when discriminating your menu system. There is an
advantage here, however, in that even if you do not bother with trustee rights
and your network is fairly open, DOSmenu will act like it is all set up just
right. In other words, DOSmenu doesn't care about the actual rights; it only
cares about whether the user is in the group name or group names that you tell
it. If not, then the user does not get the menu item displayed (and therefore
cannot run it). Note that the group method is ignored on a stand-alone
system.
;-----
Paradox
{g=paradox}
paradox
;-----
User gets item only if a member of group PARADOX.
User rights (Netware only unless DOS variable/command line parameters used)
-----------
Rule = {u=user_id or u=user_id1,user_id2 ..}. This method takes the
discrimination down to the actual user id running the system. If the user
name is in the list, then the user gets the item on their menu (if any other
specified rights are also approved and the server-based convention allows it).
;-----
Paradox
{u=joeb}
paradox
;-----
User gets item only if his user logon ID is JOEB.
Node rights (DOS variable/command line parameter is required for this right)
-----------
Rule = {n=node_address or n=node_address1, node_address2 ..}. This method
takes the discrimination down to the actual user's work station. If the node
address is the same as that of the work station, then the user gets the item on their menu (if any other
specified rights are also approved and the server-based convention allows it).
;-----
Paradox
{n=fa164505}
paradox
;-----
User gets item only if his work station's address is FA164505.
You must pull the work station's node address to DOS by setting it to a DOS
variable from within the network's initial start-up script. Only then can you
check for it from the menu system.
Password rights
---------------
Rule = {p=password where password is any alphanumeric, non-case sensitive,
from 1 to 10 characters long}. Placing a password on a menu item means that
when the user selects this item (no matter what type it is - command or
submenu), he or she will be prompted for the correct password. If the user
does not know the password, then the user cannot access the item. This right
does not actually remove a menu item from the user's menu (as all of the
other rights do); rather it simply restricts access.
;-----
Paradox
{p=restrict}
;-----
User gets item only if he or she can answer the password prompt with RESTRICT.
Question rights (not really a 'right')
---------------
Rule = {q=your question that demands a yes/no answer?} This method does not
disable the menu item from the user's menu system. Instead, it simply pops up
yoour question and asks for a Yes or No answer. If the answer is no, then the
item will not be run.
;-----
Paradox
{q=Are you sure?}
;-----
Run rights (not really a right)
----------
Rule = {r=nobreak}. This is where you determine whether batch files will be
run with a second copy of the DOS command processor (NOBREAK) or not. This
right is only appropriate when running multi-line commands (which DOSmenu
turns into batch files) or by running batch files; it should not be used
unless batch files are being run (and then it is your choice). One
disadvantage of running NOBREAK is that netware search mapping commands within
batch file will not work.
;-----
M My batch file
{r=nobreak}
dir \
pause
;-----
;-----
WordPerfect
{r=nobreak}
wp.bat
;-----
Location rights (not really a right -for notices only)
---------------
Rule = {r=one_to_three_letters}. You may optionally place this right on a
notice to set the location of it on the screen, like
;-----
{l=tl}
A note
;-----
where T=top, L=left, B=bottom, and R=right (side of screen), N=noise and
f=Flash title.
NOTES
=====
More than one of the above methods may be used at one time, either within the
same right grouping or by having two or more groupings separated with a ';'.
For example, you can place both a server (s=) method and a group (g=) method
on the same menu item, like:
;-----
Paradox
{g=paradox} {s=server1}
paradox
;-----
Here, it is read as member of paradox group _AND_ on server1.
;-----
Paradox
{g=paradox;s=server1}
paradox
;-----
Here, it is read as member of paradox _OR_ on server1.
Note that when using more than one grouping, each of the groupings must be
true for the item to be shown (they are ANDed). When using one or more
methods within the same group, they are ORed.
Placing a '!' before a name means 'not'. Where {g=paradox} means if the
current user is a member of group paradox, then display the menu item;
{g=!paradox} means display the item only if the current user is NOT a member
of group paradox (they are ORed only within each set of braces {}).
You may use spaces instead of commas. The syntax {g=group1,group2} is the
same as {g=group1 group2}.
The biggest rule that you must remember about the rights methods are that
withing each set of braces {}, the answer must be true. So if you use more
than one set of braces for a menu item, they all must be true. For example:
;-----
P Paradox {g=paradox} {u=joe,jim;n=fa164505} {s=!server2}
;-----
will only show on the menu if the user is a member of the PARADOX group _AND_
the user is JOE _OR_ JIM _OR_ the node address is FA164505 _AND_ the user is
not on SERVER2.
TESTING YOUR MENU
=================
After you have placed a lot of restrictions on your menu items, you may find
it frustrating to see what the final outcome of an item looks like. There is
a way around this.
Enter a bogus user id and server name from the command line. For instance, if
you reside on SERVER1 but wish to check the appearance of SERVER2's menu, then
enter the start-up batch file with the command
MENU /U:USER_ID /S:SERVER2
where user_id is the name you wish to check for SERVER2. You can do this for
all of your servers and any user.
MENU RULES (11)
==============================================================================
The syntax for the menu file requires certain conventions. In most cases,
DOSmenu will issue an error message if it has trouble interpreting the file
because of a syntax violation of one of the below described rules. If you get
stuck in an error loop within the batch file, press Alt-F10 at the read error
message window to quit.
RULES
=====
Main menu name
--------------
The first line of the file must be the main menu's name, starting with a
percent symbol '%'. You can optionally place the starting x and y coordinates
of the menu window after the menu name, like: %Main Menu, 5, 10. This means
the upper left corner of the menu will be 5 columns from the left edge and 10
rows from the top (after the banner line).
Server sections
---------------
There must be at least one server name before any menu items, even if
operating in a standalone environment, like :ALL. Use :ALL as a minimum just
after the main menu title and the one REQUIRED blank line.
Comments
--------
Any line starting with a semi-colon ';' is a comment for you only. Keep them
to a reasonable number to help keep your menu file small unless you plan on
compiling your menu files.
Blank lines
-----------
Blank lines are only allowed before a server section and before a menu title.
Remember, blank lines are always REQUIRED before all server sections, e.g.,
before any line starting with a colon ':', which are lines designating server
sections and names like :SERVER1 or :ALL and they are REQUIRED before sub-menu
title lines, e.g., before any line starting with a '%', which are sub-menu
item titles. See the Menu File Example section for a properly formatted file.
Menu action character
---------------------
The first letter of a menu item will always be highlighted and will be
searched when the used presses a key to move to a particular menu item. It
may or may not be part of the first word of the menu item. For example,
Lotus 1-2-3 and
L Lotus 1-2-3
offer the same result. It is a cosmetic choice that you must make. Of
course, you could also use
1 Lotus 1-2-3.
Indenting
---------
All server name lines and menu item lines must NOT be indented. All help
lines, rights lines and DOS commands MUST be indented at least one space. A
tab character is allowed for the indentation.
Parameters
----------
Single-command menu items may be setup to ask the user for a parameter prior
to actually running the command associated with the menu item. This is not
allowed for multi-command menu items. Place a question mark '@' at the exact
location you wish to add input to the command. Here are some examples:
dir @ /p
chkdsk @:
format @: /u
For multi-command items, use the DMQuery syntax (see DMQuery Input Utility
section).
Sub-menu names
--------------
All sub-menu names, both when called as a command and when entered as a
sub-menu title, must start with the percent symbol '%'. There MUST be a
blank line before the sub-menu name. Sub-menus must come somewhere _after_
the menu item that calls them.
Help lines
----------
Help lines for each menu item, if used, must be indented and start with a
number symbol '#'. There can be a maximum of one help line per menu item.
NOTES
=====
You may rename DOSMENU.MNU to another name or copy it to another menu file
because DOSmenu will run any menu file that you have as long as you
specify that file name on the command line.
MENU [/U:USER1] [/S:SERVER1] MYMENU.MNU
and
MENU MYMENU.MNU
will both attempt to load MYMENU.MNU from DOSmenu's home directory (where all
menu files must be located) instead of the default DOSMENU.MNU.
LOADING ADDITION MENUS
======================
You may switch menu files from within the menu system by LOADing them. This
is accomplished by placing the /LOAD MENU_FILE as the first and only
command line for a menu item, like:
;-----
Support Menu
/load support.mnu
Word Perfect
wp
;-----
Here, if Support Menu is chosen, then the system will load the SUPPORT.MNU
menu file from DOSmenu's home directory to replace the active menu file. You
may do this an unlimited number of times.
SUB-MENUS (12)
==============================================================================
Sub-menus are just like the main menu except that their title is the first
line of their definition. The main menu's title is the first line of the
menu file. Their title must start with a percent '%' character, and when
called from another menu, this percent character must be included. Here is an
example:
;-----
%Main Menu
Word Perfect
wp
Utilities
%Utility Menu
Paradox
paradox
;The , 5, 10 is optional and determines x and y menu window coordinates
%Utility Menu, 5, 10
Directory of...
dir @ /p
Check disk
chkdsk @:
;-----
Here, the sub-menu '%Utility Menu' is called from one of the main menu items.
Sub-menus follow the server-based convention along the vertical development of
the menu file. In other words, if a sub-menu is found under the :SERVER2
server name line, then it will not be accessible from a menu calling it which
is situated under :SERVER1. Sub-menus are typically placed at the end of the
menu file under an :ALL alias server name section.
Sub-menus can only be shown on the screen once, yet they can be called from
more than one menu. For example, if the main menu calls sub-menu2 with one of
its items, it is ok for sub-menu1 to do the same thing. However, if sub-menu2
calls sub-menu1 also, and you select sub-menu1 from the main menu, then select
sub-menu2, and then try to select sub-menu1 again, DOSmenu will issue a
non-destructive error explaining that sub-menu1 is already on the work space.
No harm will be done, but you will have to back up to use sub-menu1 again.
There is, of course, no way to call the main menu from a sub-menu because of
the above restriction.
When viewing a sub-menu on the menu screen, a right arrow will be added to the
sub-menus menu item text to denote the fact that it is a sub-menu.
COMPILING MENU FILES (13)
==============================================================================
The DMUtil program will compile and decompile init and menu files, if desired.
The syntax is:
DMUTIL /C [FILE_NAME] (filename only needed if not DOSMENU.MNU)
The output compiled file will be the same name. You can then later decompile
the file with the command:
DMUTIL /D [FILE_NAME] (filename only needed if not DOSMENU.MNU)
in order to edit it.
Compiling init and menu files is not, repeat not, required. Your users can
run DOSmenu all day long without ever comiling one file. However, there are a
couple reasons why you may wish to consider compiling them after they have
been tested.
Reasons to compile:
o DOSmenu loads them a little faster.
o You menus are much more secure when compiled. Even smart users will not
know what rights you have put where, what the passwords are, etc.
The choice is yours. DOSmenu is smart enough to know what type of file is
being loaded.
TRANSLATING MENU FILES (14)
==============================================================================
You can easily translate netware batch files to DOSmenu batch files with the
DMUtil utility with the following command:
DMITIL /T NETWARE_MENU_NAME
The server name flag :ALL will be placed two lines after the main menu title.
If your netware menu used any @variable"fill-in lines", then you must change
them within the new menu file to DOSmenu's format as it uses the external
DMQuery utility for this purpose with additional options. See DMQuery Input
Utility section for more.
TEMPORARY BATCH FILES (15)
==============================================================================
When a selected menu item has more than one DOS command listed below it, it is
called a multi-command menu item. Normally DOSmenu simply takes the DOS
command and stuffs it in the DOS variable _dosmenu so that the start-up
batch file, MENU.BAT, can then run it after DOSmenu quits. However if their
is more than one DOS command, this approach would not work.
Therefore DOSmenu instead will make a temporary batch file and stuff the name
of that batch file to the variable instead.
The location and name of the temporary batch file is as follows:
Name
----
On a Novell network, the name will be @DMBATXX.BAT where XX is the actual
network connection number taken by the user's work station. This way, a user
could actually run the menu system from two different work stations under the
same login ID without problems.
If not on a Novell network, then the batch file is named @DMBAT.BAT.
Location
--------
If the Private Directory option in the menu file was filled out with a
directory, then the batch file will be written and run from that directory.
If not, then it will be written and run from DOSMENU.EXE's home directory,
which is fine for stand-alone environments.
Notes
-----
Each time a temporary batch file is made, a '@echo off' is automatically
placed at the top of the file, relieving you from having to add that cosmetic
line to every multi-command menu item.
Example
-------
If a menu item looked like this:
;-----
Word Perfect
f:
cd\apps\wp51
wp
h:
cd\
;-----
then the corresponding batch file would look like this:
@echo off
f:
cd\apps\wp51
wp
h:
cd\
DOS ENVIRONMENT VARIABLES (16)
==============================================================================
DOSmenu uses up to five DOS variables to make the system work without _any_
overhead; a variable for the user ID, a variable for the server name, a
variable for the work station node address, a variable to hold the command
for a selected menu item, and an optional variable to hold the last time the
DOSMENU.NTE file was changed (for noticing).
The node address variable is always needed if you intend to rstrict any menu
items by comparing a work station's node address. IN a Novell network, you
could define this variable like:
DOS SET _NODE="%P_STATION"<<4
where the <<4 takes the first 4 number away from the actual twelve digit
address.
The user ID and server name variables are only needed if you are not running
on Netware and are not on a stand-alone environment. In this case, you define
and load two DOS variables once during the user login start-up script with the
correct information. In the case of Novell (where this procedure is not
necessary) you would add these lines to the login script:
DOS SET _USER="%LOGIN_NAME"
DOS SET _SERVER="%FILE_SERVER"
where _user and _server and be called anything you wish. You would then add
these two names two the menu file options/switches section so DOSmenu will
know what they are called. It takes care of the rest.
The variable for the menu item command is called _dosmenu and is always used.
When a menu item is selected that has an associated command that is not
another menu (sub-menu command), then DOSmenu either places that command in
this DOS variable if it was a singular command or else DOSmenu makes a batch
file out of the multiple DOS commands for that menu item and then passes the
name of the batch file to this variable. Either way, the MENU.BAT file then
runs that command kept in the variable _dosmenu.
The last variable, _DMNTE, is used when you wish to leave dynamic notices to
any and all users. See the Noticing section for specifics.
DMQuery also uses environment variables. It will use up to 9 variables named
@1, @2, .., @9.
EXAMPLES (17)
==============================================================================
INIT FILE (network -commented)
=========
;These are options/switches that control the menu system. They are defined in
;the Setup section.
;Novell netware in use?
Using Netware=yes
;If yes, then ignore these two. Otherwise, name of DOS variable to be used.
Non-Netware DOS User Var=
Non-Netware DOS Server Var=
;The node address of the work station (optional)
Any-Network DOS Node Var=
;A directory users can write to.
Private Directory=h:\
;Help screen support notice.
Comment Line=For HELP Please Call Support At 512-590-4444
;What color should the screen background be?
Desktop Color=71
;Enter 0 to disable. Number represents minutes.
Screen Saver Time=3
;Password to allow users to run DOS commands with the F2 function key
F2 Run DOS Password=dos
;Password to allow users to quit the menu system.
F10 Quit Menu Password=secret
;Enter 0 to disable. Number represents minutes.
Timed Quit Menu Time=30
;If timed out, what command should we run?
;This could also be 'goto end'.
Timed Quit Menu Command=logout
MENU FILE (network -commented)
=========
The below network menu file example is listed with a generous helping of legal
and illegal comments. Note that comments must commence only at the start of a
line and NOT at the middle to end of a line even though we use it here to
better comment the code for you.
;The menu name for this overall main menu below.
%Our Network Menu, 10, 5 ;numbers optional: 10 = x, 5 = y on screen
; placement of upper left corner of menu window
;This server section means any server and/or a stand-alone environment.
;These commands will be at the top of every user's menu.
;Remember to place a blank line before all :SERVER_NAME lines
:ALL
M Mail
;All members of EMAIL_USERS will get the Mail menu item.
{g=email_users}
;The help line for this item (shown at the botom of the screen)
#Send and receive mail to and from other users
;If selected, the command/permanent batch file EMAIL will be run.
email
;This section is for CENTRAL server users only.
:CENTRAL
P Paradox
{g=support,paradox} {p=restrict} ;
#Database program ;This is a multi-command item that
f: ; generates a temp batch file.
cd\apps\paradox
paradox
W WordPerfect
{g=wp_central}
#Word processor
f:\apps\wp51\wp
1 Lotus 1-2-3
{g=lotus_users,finance}
#Spreadsheet program
lt123
;The next item ask a yes/no question first.
C Check printing
{u=check_printer} {q=Are you sure you want to print checks?}
#Print all due checks to the upstairs printer
checkprt
I INSAPP
{g=insapp_users,support;u=adm} {s=server1}
#Our main database application
ins
C Checks printed by and for you so far this week
{g=insapp_users}
checks
V Vendor list
vendors
S Support Menu ;Another complete menu file which is called
/load support.mnu ; with this line.
;This section is for BRANCH_ONE server users only.
:BRANCH_ONE
A Central connection
{g=awlan}
#Connect with the home office by modem
connect
W WordPerfect
{g=wp_branch}
#Word processor
wp
H Home office support (setup modem)
{r=nobreak} {f:\utils\awlan}
f:
cd\utils\awlan
awlan -u=%user%
h:
cd\
;This server section means any server and/or a stand-alone environment.
;These commands will be at the bottom of every user's menu.
:ALL
U Utility Menu
#Various utilities
%Utility Menu
B Backup Server Menu
#Backup options
%Backup Server Menu
L Logout of network
{q=Are you sure?}
#Log out of the network
logout ;You could also enter 'goto end' to simply quit
; the menu system, if desired.
;Remember to place a blank line before all %SUB-MENU NAME lines
%Utility Menu, 5, 10 ;Display at xy coords 5 and 10 on screen
P Change your network printer
capture@ ;This command asks a question first.
C Calculator
#An electronic calculator
calc
D Directory of...
#Obtain a directory listing: press F3 after to view the list again
dir @ /p ;This command asks a question first.
D Directory of (another way)...
echo Directory of what?
dmquery 1 ;DMQuery external batch utility
echo Switches (/w /p, etc)?
dmquery 2
dir %@1% %@2%
pause
%Backup Server Menu
D Daily backup procedure
bud
W Weekly backup procedure
buw
M Monthly backup procedure
bum
CREDITS (18)
==============================================================================
Turbo Pascal is a trademark of Borland International.
MS-DOS is a trademark of Microsoft Corporation.
Netware and Novell are registered trademarks of Novell, Inc.
Windows is a registered trademark of Microsoft Corporation.
Trademarks of other companies or products mentioned in this file are the
property of their respective companies.
VERSION UPDATES (19)
==============================================================================
4.1
o Full mouse support added (with registered version only)
4.1a
o Bug fixes in notices and additional LOCATION right added for notices.
4.1b
o Forces DOSmenu to 25 line screen is not already there.
SHAREWARE (20)
==============================================================================
Evaluation Copy
---------------
THIS IS NOT FREE SOFTWARE! You may evaluate and use this product, but if you
decide to make use of it on a regular basis, you must register your copy.
Note: Businesses, government agencies and institutions are required to
register this software package before extended use.
We offer several inducements to you for registering. First of all, you will
receive the most up-to-date copy of the program -- and we update the program
on a regular basis. Second, full mouse support is available in the registered
version. Third, we have additional mini-utilities that work nicely with
DOSmenu not included in this package that we will ship to you upon
registration. Fourth, you will never see the shareware message again. Make
no mistake, however -- this is a fully functional version of DOSmenu that is
not "crippled" in any way.
Distribution
------------
This is "user-supported" software. You are hereby granted permission to
distribute this evaluation copy of DOSmenu and its documentation, subject to
the following conditions:
1. Shareware DOSmenu may be distributed freely without charge in evaluation
form only.
2. DOSmenu in its shareware form may not be sold, licensed, or a fee charged
for its use. If a fee is charged in connection with DOSmenu, it must
cover the cost of copying or dissemination only. Such charges must be
clearly identified as such by the originating party. Under no
circumstances may the purchaser be given the impression that he is buying
a registered version of DOSmenu.
3. Shareware DOSmenu must be presented as a complete unit with documentation.
Neither DOSmenu nor its documentation may be amended or altered in any way
without permission of the copyright holder.
4. By granting you the right to distribute the evaluation form of DOSmenu,
you do not become the owner of DOSmenu in any form.
Any other use, distribution or representation of DOSmenu is expressly
forbidden without written consent from the author.
Registration
------------
The non-commercial single-user registration fee for DOSmenu is $40.00 US.
($5 shipping is included.)
The commercial/government and multi-system site fee for DOSmenu is:
Non-network environment:
Per machine - $110.00 US.
Network environment:
Per server - $160.00 US.
($10 shipping is included.)
Send a check, money order or company P.O. for the appropriate amount to:
Skip Bremer - DOSmenu
3401 Cactus Wren Way
Austin, Texas 78746
No credit cards. Thank you.
Telephone: 512-328-2465
Compuserve ID: 71614,2556
Disclaimer
----------
The author does not warrant that the functions contained in this program will
meet your requirements or that the program operation will be uninterrupted or
error free.
The author specifically disclaims all other warranties, expressed or implied,
including but not limited to implied warranties of fitness for any particular
purpose and of merchantability.
In no event will the author be liable to you for any damages, including but
not limited to any lost profits, lost savings, commercial damage or other
incidental or consequential damages arising out of the use or inability to use
this program, or for any claim by any other party.