                    Novells NMENU Utility
                       By: Doug Archell
                        (doc rev 1.1)
                                
  Disclaimer and Other Info
  
  Please be advised that no warranty either expressed or implied is issued with this
  document.  While the technical accuracy has been reviewed, I cannot be responsible for
  any problems that you may encounter which result from using this information.
  
  This document may be copied and distributed freely as long as the following criteria are
  met:
  
          You may NOT alter the contents of this file in any way
          You may NOT profit from the distribution of this file
          Due credit regarding the authorship of this file MUST be given
  
  Aside from the three restrictions noted above, feel free to use it in any way that you see
  fit.


  Intro
  
  In NetWare 3.12 and 4.0, Novell replaced its original C-Worthy menuing system with a
  new system licensed from Saber Corporation. This new menu is a scaled-down version of
  the popular Saber menuing system. 
  
  Creating menus with NMENU is fairly straightforward, but there are a couple of
  "gotchas" you should be aware of. This document examines the NMENU system and
  some of the more common problems people experience in setting up NetWare menus and
  how to avoid them. 
  
  Before proceeding, remember, Novells NMENU is a scaled down version of Saber's
  menuing  system and does not include as many commands or all of the same features. 
  
  1.           Setting The Right Environment
  
  Writing your menus is only one aspect to designing and implementing a menuing system
  that works.  There are a few configuration issues that must be addressed prior to running
  the menus. Within the following sections, you will find key info on establishing the right
  environment to run your menus.
  
  1.1          Before You Begin: Changing the Login Script
  
  To enable the NetWare menus to work properly for all users, you should include the
  following SET parameters in the system login script (called the container login script in
  NetWare 4.1): 
  
     SET S_FILEDIR="X:\\PUBLIC\\TEMP\\" - This parameter specifies where
     NMENU should store its temporary files. You can replace the drive and directory
     name (X:\\PUBLIC\\TEMP\\ ) with information appropriate for your network, but you
     must follow the convention shown here, with double backslashes between the
     directories.
     
     SET S_FILE="%STATION" - This parameter is used to create DOS environment
     variable based on each user's station connection to the file server. For example, if your
     station connection to the file server is 14, this parameter will establish the environment
     variable S_FILE=14. When NMENU creates the temporary files in the TEMP
     directory specified above, it will use the S_FILE parameter to name the file.  This
     temporary file is then  used by NMENU as identification for each user accessing the
     menus. 
     
  CAUTION - Make sure the "%STATION" is entered in all uppercase or it wont work.
  
     SET S_MENU="menuname" - This parameter tells NMENU which menu file you
     would like the users to use. Depending on your specific environment, you might have
     several menus on your server that are accessed by different users or groups. Using this
     parameter, NMENU will know which menu to load.  Replace menuname with the
     name of the desired menu. Note: Make sure you place the menuname within the
     double quotes. 
     
  If there will be multiple menus on your server, you can use the IF-THEN login script
  statements to determine which users will access which menus.  For example, if you
  had a group called EXAMPLE on your server that you wanted to setup for the ACCESS
  menu, you could use the following login script command:
  
     IF MEMBER OF "EXAMPLE" THEN BEGIN
          SET S_MENU="ACCESS"
     END
  
  1.2          Setting Up NetWare Rights
  
  When you install NetWare, the NMENU program files and utilities are copied to the
  SYS:PUBLIC directory. Since NetWare automatically assigns the group EVERYONE
  Read and FileScan rights to the PUBLIC directory, you do not need to grant users
  additional rights to this directory. However, you will need to assign users rights to the
  temporary directory you set up (shown as the TEMP directory above in the SET
  S_FILEDIR parameter). 
  
  Carefully choose the location of your temporary NMENU directory. For this directory,
  users must have the rights Read, Write, Create, Erase, Modify,  and FileScan. Ideally, you
  should create a separate directory for the temporary files. Although any directory will
  work--for example, you could use PUBLIC (but shouldn't)--creating a separate temporary
  directory will ensure that all temporary files are kept in their own directory. As a result,
  you will not have to worry about granting excessive rights to a NetWare or production
  data directory. 
  
  TIP : If you follow the suggestion above to create a separate directory for use by the
  temporary files, flag the directory as PURGEable with the FLAGDIR command. Over
  time, as the temporary files are continually created and deleted, an excessive number of
  these files can remain in a salvageable state.  If too many of these files accumulate over
  time, a variety of errors can appear on your system.
  
  2.           Creating Your Menus
  
  Once you have laid the foundation for your menus, the next step is to actually write your
  menu script file.  Within the following section you will find a listing of each of the
  commands that can be used within your menus and examples of how they can be used.
  
  2.1          The Menu Source Script Layout
  
  The source file used with NMENU is a basic ASCII text file, but there is a certain layout
  that you should adhere to when writing the script.
  
  Following are a few points to keep in mind when writing your script:
  
     Menu and submenu titles (noted with the MENU script command) that are used in the
     script are placed flush, against the left margin of your script.
       
     Every MENU command must be followed by at least one ITEM command.
       
     ITEM commands are indented one tab from the left margin.
      
     Every ITEM command must be followed by at least one EXEC or LOAD command.
       
     EXEC or LOAD commands are indented two tabs from the left margin.
       
     REMark statments can be added to your script but they must be preceded by a semi-colon.
     
  To illustrate these guidlines, following is a very basic sample script:
  
  ;*********************************************************
  ;*                                                                                                          *
  ;* Menu          : EXAMPLE.SRC                                                          *
  ;* Created       : 21:16:00 02/06/95                                                        *
  ;*                                                                                                          * 
  ;*********************************************************
  
  ;MAIN MENU
  MENU 01,Main Menu 
     ITEM Word Processing ...
               SHOW 10
     ITEM Utilities ...
                    LOAD UTILS.DAT
     ITEM Printing Commands ...
                    SHOW 20
          ITEM SHELL TO DOS 
                    EXEC DOS
          ITEM UNLOAD NMENU
                    EXEC EXIT
          ITEM LOGOUT OF LAN
                    EXEC LOGOUT
  MENU 10, Wordprocessing
               ITEM Wordperfect
                    EXEC F:
                    EXEC CD H:\WP51
                    EXEC H:WP51
                    EXEC CD H:\
  MENU 20, Printing Commands
               ITEM Capture To A Network Printer
          GETR Enter The Print Q Number To Capture To:  {} 2,1, {}
                    EXEC CAPTURE L=1 TI=2 Q=PRINTQ_
               ITEM Capture To A Local Printer
                    EXEC ENDCAP
  
  2.2          NMENU Script Commands
  
  Within your NMENU script, there are several commands that are available to you.  If you
  are familiar with the Saber Menu system, this listing will seem short to you.  While
  Novell's NMENU system is based on Saber Menu's, it does not incorporate the same
  degree of functionality.
  
  Even though this listing of commands is limited, used properly, you will be able to create
  an effective, and reasonably powerful menu.
  
  COMMAND EXAMPLE                      	 		DESCRIPTION
  MENU    MENU 02, WORD-PROCESSING      		Designates the name and start 
                                        		of the menu or submenu.
                                       	
  ITEM    ITEM WordPerfect { BATCH }    		Designates a menu entry.
                                        
  EXEC    EXEC H:\WP51.EXE    				Tells NMENU the DOS
							commands you want
						        executed.
                                        
  GETR    GETR Enter Default Drive: { } 2,F,{:}		Prompts the user for
						        additional information that 
							is  required.
                                        
  GETO 	  GETO PrintQ Name: { } 10,PRINTQ1,{}    	Prompts the user for
        						additional information on an    
	                                                optional basis.
                                        
  GETP    GETP Name Of File To Copy: { } 12,,{}   	Stores information
        						entered by the user for use later.
                                        
  LOAD    LOAD SUPPORT.DAT   				Loads an additional menu
						        from another script.
                                        
  SHOW    SHOW 4  				        References a submenu within
							the same menu script.
                                       
 2.2.1     The MENU Command
  
  The MENU command is used to identify a menu or submenu title within your script.  You
  can have a maximum of 255 MENU commands in a single script.
  
  You use the MENU command as follows:
  
     MENU menu_number, menu_title
     
  Based on the syntax above, replace:
  
       menu_number with the number of the menu or submenu. The number that you
       assign has no bearing on the order in which the menu files are displayed.  It's
       purpose is to allow you to reference the appropriate menu using the SHOW
       command. 
       
       menu_title with the name of the menu or submenu.
       
  2.2.2   The ITEM Command
  
  The ITEM command is used to specify the different items within your menu script. You
  can only have a maximum of 12 ITEM commands for every MENU command in your
  script.
  
  This command is used as follows:
  
     ITEM item_title {parameters}
  
  Based on the syntax above, replace:
  
  	item_title with the name or phrase that you would like to be used as the menu
       option up to a maximum of 40 characters in length.
       
	parameters with one or more of the parameters shown in the table that follows.
       Multiple parameters can be used for each item, but each one must be separated
       with a comma.
       
  PARAMETER EXAMPLE   					DESCRIPTION
  
  BATCH     ITEM HARVARD GRAPHICS {BATCH}     		The BATCH parameter is
     							added to the end of
					                the ITEM line to tell NMENU
							to remove the menu system 
							from memory (temporarily)
							when executing a command. 
							When using the BATCH command,
							you can save roughly 32K of 
							RAM, but you will slow down
							the reloading of the menus
							slightly.
                                     
  CHDIR     ITEM LOTUS { CHDIR } 		     	The CHDIR parameter is   
							added to the end of the ITEM
                                        		line to tell NMENU to return
							to the previous default   
							directory after the processing
							is completed.
                                     
  PAUSE     ITEM DIR {PAUSE}    			When PAUSE is added to
							the end of the ITEM line,     
							messages are left on-screen   
							until the user presses a key.
                                     
  SHOW      ITEM DOS COPY { SHOW }        		By adding SHOW to the end     
							of your ITEM line, NMENU      
							displays the commands as      
							they are executed.
                                     
  The order in which the menu options are available is determined by the order that you
  enter your ITEM commands. For example, the first ITEM command will be option A in
  the menu, the second, option B in the menu.  But, you can override these values and use
  your own by using the ^ (carot) symbol in conjunction with your ITEM menu command as
  follows:
  
     ITEM ^x item_title {parameters}
  
          replacing x with the desired letter.
  
  2.2.3   The EXEC Command
  
  The EXEC command executes a DOS command, or string of commands, following the
  ITEM command. There is no limit to the number of EXEC commands that can follow an
  ITEM command. When using the EXEC command, it is entered into the script as:
  
     EXEC command
  
  Based on the syntax above, replace:
  
  	command with the command(s) you want passed to DOS, up to a maximum of 250
       characters. Since DOS will not accept commands of more than 250 characters on a
       single line, you can break up commands by using the + sign. An example would be:
       
  		ITEM Capture To PrintQ1
                      EXEC CAPTURE +
                      L=1 Q=PRINTQ1 TI=2
                
  If the above were added to a menu, selecting this item would successfully capture to
  PRINTQ1 with a time-out value of 2. The one thing that you must remember when using
  EXEC is that you must either specify the location of the program that you are intending to
  run, or the program must be within the current path.  For example, if the CAPTURE
  command used above was not in the current path, but could be found on the G: drive, you
  would use the following EXEC command:
  
	  	ITEM Capture To PrintQ1
                      EXEC G:CAPTURE +
                      L=1 Q=PRINTQ1 TI=2
                 
  In addition to executing standard DOS commands, there are a few script commands that
  can be used as shown in the table below. When using these commands, make sure that you
  enter them in CAPITAL letters.  Unless noted otherwise, the commands will not work
  when entered in lowercase.
  
  PARAMETER  EXAMPLE   					DESCRIPTION
                                     
  CALL       EXEC CALL REPORT.BAT     			Calls a batch file from within     
							the menus.
                                     
  DOS        EXEC DOS  					Lets the users jump to a DOS
							shell from within the menus.  
							When they want to return to   
							the menu, they must type      
							EXIT from the DOS prompt.
                                     
  EXIT       EXEC EXIT 					Exits the menu program and    
							returns the user to the  
							command prompt.
                                     
  LOGOUT     EXEC LOGOUT    				Exits from the menus and      
							logs the user out of the      
							network. Please refer to      
							section 6 below for      
							information on properly  
							logging out of the server from
		                                        within the menus.
                                     
  2.2.4   GETting Information from the User
  
  The NetWare menus enable you to request information from the user that then can be
  passed onto an EXEC command by using one of three commands:
  
     GETR - GETR requests mandatory information. The information gathered is added to
     the end of the following EXEC command.
       
     GETO - GETO requests optional information. The information gathered here is added
     to the end of the following EXEC command.
       
     GETP - GETP requests information that will be used in more complex EXEC
     commands from the user. There can be up to nine GETP commands after a single
     ITEM command. The information gathered from each GETP command is assigned a
     variable between %0 and %9. These variables then can be called into the following
     EXEC command.
     
  Regardless of which parameter you use, the syntax for entering it in the script is as
  follows:
  
     GETx prompt {prepend_text} length,prefill_text, {append_text}
  
  PARAMETER    		DESCRIPTION
  
  prompt  		The text displayed to the user.
                           
  prepend_text 		The text entered before the user's text. Watch your
                        spacing! Any spaces between the curly brackets will
                        be used.
                           
  length  		The maximum number of characters the user can
                        enter : up to 255.
                           
  prefill_text 		The text placed in the entry window by default. You
                        can call DOS environment variables as the default by
                        enclosing them in % signs (such as %SERVER%).
                           
  append_text  		The text entered after the user's text. Watch your
                        spacing! Any spaces between the curly brackets will
                        be used.
                           
  Examples of acceptable GETx commands include:
  
  		GETO Enter the print queue number: {PRINTQ_} 2,, {}
  		GETR Enter the username to scan for: {} 47,%NAME%, {/a}
            	GETP Enter the file name: {} 12,, {}
            
  3.           Compiling the Menu Script
  
  After you have completed the creation of the script file, you must compile it before it can
  be used. To compile the script you must use the MENUMAKE utility found in the
  PUBLIC directory. The proper syntax for using MENUMAKE is:
  
  MENUMAKE menu_source_file
       
  Based on the syntax above, replace:
  
  	menu_source_file with the name of the source file that your created.  By default,
       MENUMAKE expects the source file to have an extension of SRC.  If you used a
       different extension, you must specify the full file name.
       
  If there are no errors in your script, MENUMAKE converts your script and creates a new
  file called XXXXXXXX.DAT, where XXXXXXX is the name of your menu file. If there
  are errors, MENUMAKE tells you on which lines the errors have occurred, so you can
  resolve them.
  
  4.           Running the Menu
  
  
  When all is said and done, you should be able to login to the file server and type NMENU
  menuname from the command line to access your new menus (replace menuname with
  the name of your compiled menu)!
  
  To make things easier for your users, you can launch the menu system at the end of your
  login  scripts by adding the following command to the script:
  
     EXIT "NMENU menuname"
  
  CAUTION - If you decide to load the menus from within the script, DO NOT load them
  with the # command processor. Loading the menus in this fashion will keep the login
  script open until the user logs out, and it will waste roughly 100K of RAM on the
  workstation.
  
  5.           Converting Older NetWare Menus
  
  If you upgraded from a previous version of NetWare, you may have been using the older
  menu system (MENU.EXE and MNU source menus). Instead of wasting time rewriting
  these scripts, you can convert them with the MENUCNVT utility. Once converted, they
  can be run in the same fashion as the newer menus.
  
  Follow these steps to use an old menu:
  
  	1. Convert your old menu file by typing MENUCNVT oldfile.mnu newfile.src
       from the DOS prompt. MENUCNVT then converts your old script into the newer
       scripting language and creates a menu file with the extension SRC.
       
 	2. Compile the new menu source file by typing MENUMAKE menuname.src.
       
       	3. Run the newly compiled menu by typing NMENU menuname.
       

  6.           Common Problems And Questions
  
  Some problems that users encounter may be unique, but in many cases, they have been
  encountered on numerous occassions at other sites out in the field.  Within this section, we
  will take a look at some of the most commons problems and how to resolve them.
  
   
  6.1          Accessing the DOS Prompt
  
  If you are familiar with NetWare's previous menuing system, you know that you could
  unload the menu by pressing <ESC> from the main menu. However, to allow users to
  unload NMENU and get to the DOS prompt without logging out of the server, you must
  add the following ITEM to your NMENU file:
  
     ITEM Exit To DOS Prompt     
          EXEC EXIT
  
  Once this menu item is accessible to the users, they can merely select this option to unload
  the menus without logging out of the file server.
  
  Alternately, the following menu item can be used to allow the user to access a DOS shell
  from within the menus.  Once at the DOS prompt, they can return to the menus at any
  time by typing EXIT.
  
     ITEM DOS Shell
          EXEC DOS
  
  
 6.2          BATCH FILE MISSING Errors 
               (LOGOUT Problems)
  
  The most common problem users have with NMENU is receiving the BATCH FILE
  MISSING error when logging out of the file server. Although users can continue to
  function normally, such errors can raise a lot of questions. So why does this error occur,
  and how can you fix it?
  
  One problem concerns using the NetWare Virtual Loadable Modules (VLMs) with
  NMENU. When NETX is run on the workstation, the path shown in the DOS prompt  of
  your first network drive is F:\LOGIN>.  With the VLMs, while  your first network drive
  letter will still place you in the LOGIN directory, the DOS prompt will not identify this
  directory, it will merely show you F:\>.  The reason for this is that, unlike NETX, the
  VLMs perform a "map root" to the LOGIN directory, thus, you will only see the F:\>
  prompt.
  
  Another problem is caused by what I like to refer to as renegade temporary files. The
  temporary files created by NMENU are critical to the proper function of the menus.
  Problems can and usually will arise when the temporary files are not deleted after you log
  out.
  
   Thankfully, you can usually avoid these two problems by completing three short steps:
  
  Set up the logout ITEM in your NMENU file as follows:
     
          ITEM Logout Of LAN     
               EXEC F:     
               EXEC CD\LOGIN     
               EXEC EXIT OUT.BAT
  
  Create a batch file called OUT.BAT in the SYS:\LOGIN directory. This batch should
  contain the following commands:
     
      @ECHO OFF
      IF "%S_FILE%"=="" GOTO STDNAME
      IF EXIST %S_FILEDIR%$%S_FILE%.* DEL %S_FILEDIR%$%S_FILE%.*
      IF EXIST %S_FILEDIR%#%S_FILE%.* DEL %S_FILEDIR%#%S_FILE%.*
      GOTO EXIT
      :STDNAME
      IF EXIST %S_FILEDIR%MENU_O.* DEL %S_FILEDIR%MENU_O.*
      IF EXIST %S_FILEDIR%MENU$$$.* DEL %S_FILEDIR%MENU$$$.* 
      :EXIT
      LOGOUT
  
     This last step is only necessary if you are using the VLMs. As noted earlier,  when
     using the VLMs, your first network drive is shown as F:\>, not F:\LOGIN>.  When 
     the OUT.BAT file is executed, once it reaches the last line and issues the LOGOUT
     command, DOS will get confused because it is looking for the F:\LOGIN> directory. 
     Once you logout of the server, DOS will think that the F: drive is really the root, not
     the SYS:\LOGIN directory.  As a result, you must create a LOGIN subdirectory in the
     LOGIN directory  on the SYS: volume and place a copy of the OUT.BAT file in there
     as well. Your directory structure will look like this:  
     
  		    SYS:\LOGIN\LOGIN
  
  6.3          Running NMENU As A Standalone Menu
  
  On occasion, you may want to run NMENU's as a standalone menu system without a
  connection to the file server.  While few realize this, you can run NMENU without a
  connection to the server as long as the necessary files are available on the workstation.
  Following is a listing of the files that you will have to copy from the server to the
  workstation to get the menus to work properly locally:
  
  SYS:\PUBLIC\NMENU.BAT
  SYS:\PUBLIC\MENU_X.BAT
  SYS:\PUBLIC\IBM_RUN.OVL
  SYS:\PUBLIC\_RUN.OVL
  SYS:\PUBLIC\MENU.OVL
  SYS:\PUBLIC\MENUCNVT.EXE
  SYS:\PUBLIC\MENUEXE.EXE
  SYS:\PUBLIC\MENUMAKE.EXE
  SYS:\PUBLIC\MENURSET.EXE
  SYS:\PUBLIC\TEXTUTIL.IDX
  SYS:\PUBLIC\NLS\ENGLISH
  SYS:\PUBLIC\NLS\ENGLISH
  
  SYS:\PUBLIC\NLS\ENGLISH\TEXTUTIL.MSG
  SYS:\PUBLIC\NLS\ENGLISH\MENURSET.MSG
  SYS:\PUBLIC\NLS\ENGLISH\MENUCNVT.MSG
  SYS:\PUBLIC\NLS\ENGLISH\MENUEXE.MSG
  SYS:\PUBLIC\NLS\ENGLISH\MENUMAKE.MSG
  SYS:\PUBLIC\NLS\ENGLISH\MENUOVL.MSG
  SYS:\PUBLIC\NLS\ENGLISH\MENURSET.MSG
  SYS:\PUBLIC\NLS\ENGLISH\MENU.HEP
  

  6.4          Changing The Menu Colors
  
  One common question is how you can change the colors used by the menus.  There is a
  very simple answer....you cant.
  
  
  6.5          Getting The Wrong Menu
  
  At times, folks have encountered problems where users would mysterious load someone
  elses menu as their own. For the most part, this problem can be found when working in a
  multi server environment.  As noted previously in this document, the environment settings
  that are created in the login script are used by NMENU for such things as controlling
  which menus are loaded.  
  
  Of specific concern are the S_FILE and S_FILEDIR settings. In a multiserver
  environment, it is possible that these paramters will not be set to reflect the server that you
  are logging into, but in fact, the server that processed your login.  For example, if your
  default server is FS1 but you are logging into FS2, these parameters may reference the
  FS1 server.
  
  To alleviate this problem, in the workstations NET.CFG file, you can add a PREFERRED
  SERVER=x statement, where X is the server that they should be logging into.
  
  6.6          Certain NMENU EXEC Commands Won't Work
  
  If you are encountering problems with NMENU EXEC not working, check your script to
  make sure that the commands are being entered in UPPERCASE.  NMENU script
  commands and variables must be entered in UPPERCASE to ensure that they work
  properly.
  
  6.7          DOS Internal Commands Not Working 
  
  If you have menu items that run DOS internal commands, check where your COMSPEC is
  set to. NMENU has a problem with referencing volume names in the COMSPEC. 
  Changing the COMSPEC from referencing a volume name to a drive letter should resolve
  this problem.
  
  7.      Thats All Folks
  
  Well, thats it for now folks.  If you have any suggestions or comments for future revisions
  of this document, please forward them to my CIS EMAIL address 70751,767.  Please do
  not leave any questions or comments regarding this document in the NOVUSER forum on
  CIS (where you probably downloaded it from).
  
  
  If you have any additional questions regarding NMENU, please leave a message in the
  NETW3X or NETW4X forums addressed to SYSOP and someone will be happy to assist.
  But, please do NOT contact Saber Corporation for assistance with NMENU. While
  Novell licensed the product from Saber, it is supported by Novell.
  
  If you found any errors or have a tip that you would like to add, please send me an
  EMAIL and I will include it in future revisions, with due credit being given of course!
  
  8.      About The Author
  
  This document was written by Doug Archell (me). Doug is an independent consultant,  
  NetWire SysOp, author of the book, NetWare 3.12 System Administrators Reference
  from Que Corporation (thats the shameless plug), a columnist for NetWare Connection
  magazine and a general work-a-holic.You can reach him (me) on CompuServe at
  70751,767. If you do not have access to Compuserve, you can also send EMAIL to me
  from the internet by addressing it to 70751.767@compuserve.com.
  
  
  