Home
Data Recovery Software
Easy to use - Free Demo & Support
After format, fdisk, system crash
Sponsored link: from ALWIL Software: avast! BART CD 2.0
HOME dot BOOTCD dot SCSI dot UTILITIES dot BOOT DISK dot MULTIMEDIA dot LINKS dot HOWTO'S dot OTHER dot ABOUT dot FORUM

Print Sponsor Nu2 Search Nu2 About Henk Support Henk Contact Henk



Nu2Menu

Dynamic shell for BartPE / WinPE

Remember, Nu2menu is still in BETA!

Version 0.3.51
Last updated: nov 22, 2005



:: Introduction
:: Menu file rules
:: Minimal menu file
:: Menu item node <MITEM>
:: Download
:: Functions
:: Frequently asked questions
:: Plans for future versions
:: History
:: Used tools/information

 Introduction


What is Nu2Menu?

Nu2menu is a dynamic shell/menu application designed for BartPE / WinPE / NT4 / 2000 / XP / 2003. It was specially created for Bart's PE-Builder. You can also use it as a (autorun) cd menu that uses the same menu file when booting from PE. It has its own scripting language to make the shell/menu dynamic. Because of the scripting language you can use the same menu file for Bart PE or Windows XP/2003. Nu2Menu uses XML to build up the menu structure.

 Menu file rules


If you create your own menu file you must obey the following rules:
- all menu nodes must be written in uppercase,
- function names for the scripting language are case sensitive
- every opening tag needs a closing tag

 Minimal menu file


A minimal menu file consist of at least three parts, namely:
- identification node (<NU2MENU>...</NU2MENU>)
- menu id node (<MENU>...</MENU>)
- menu item node (<MITEM>...</MITEM>)

With identification node, the menu system sees that this is the beginning of the menu information.

With the menu id node, you give a menu group a name. This name is used for linking it as a sub-menu e.g. <MITEM TYPE="POPUP" MENUID="System">System</MITEM>. The first menu id node is also the starting menu of Nu2menu (the one that pops up first).

Nu2Menu skeleton:
<!-- Nu2Menu entry -->
<NU2MENU>
   <MENU ID="Main menu">
      <MITEM TYPE=ITEM,POPUP,SEPARATOR DISABLED=... CMD=... FUNC=... >Description</MITEM>
   </MENU>

   <MENU ID="Sub menu">
   ...
   </MENU>
</NU2MENU>

 Menu item node <MITEM>


The menu item node does have several sub nodes, namely:
- TYPE
- DISABLED
- CMD
- FUNC
- PARM

The TYPE node can have one of the following parameters:
- ITEM -> define the name of the menu entry, this is visible in the shell
- SEPARATOR -> create a separator in the menu structure
- POPUP -> define a new sub menu

The DISABLED node is for disabling the current menu item. If DISABLED="1" then the menu/shell item is disabled.

The CMD node can have one of the following parameters:
- HIDEFROMTASKBAR -> hide the Nu2Menu from the taskbar.
- SHOWINTASKBAR -> let the Nu2Menu be visible in the taskbar
- RELOAD -> reload the menu structure
- RUN -> executes the FUNC sub node from the menu item node

The FUNC node can only work if CMD="RUN".

All sub nodes can use the nu2menu functions. For a complete list of nu2menu functions see: Function list

Here is the nu2menu file mozilla_Embed_nu2menu.xml:

<!-- Nu2Menu entry -->
<NU2MENU>
   <MENU ID="Programs">
      <MITEM TYPE="ITEM" DISABLED="@Not(@FileExists(@GetProgramDrive()\Programs\MozillaEmbed\mfcembed.exe))" 
         CMD="RUN" 
         FUNC="@Null(@ChangeDir(@GetProgramDrive()\Programs\MozillaEmbed))@GetProgramDrive()\Programs\MozillaEmbed\mfcembed.exe">
         MozillaEmbed(browser)
      </MITEM>
   </MENU>
</NU2MENU>

Short explanation of the used functions:
@Not() -> logical not function, 0 will be 1, 1 will be 0

@FileExists() -> Checks if file exists
Parm1 (string) : filename to check
returns:
" 0" -> filename does not exists
" 1" -> filename exists

@GetProgramDrive() -> Returns the nu2menu.exe's program drive, e.g. "c:"

@Null() -> redirect output to null device

@ChangeDir() -> Change directory
Parm1 (string) : name of directory
returns:
" 0" -> directory not changed, something went wrong
" 1" -> directory change successful

The DISABLED node in the example checks of the executable is on the booted media. The result will be inverted. In other words: If the file is not found on the booted media, the shell entry will be disabled.

The FUNC node in the example changes the directory to where the Mozilla Embed executable is situated. After that it will run the Mozilla executable. Because of the 'ChangeDir' result, the output must be redirected to the null device. If we don't do this, Mozilla won't get started.

 Download


You can download Nu2Menu here: Nu2menu Beta V0.3.51 (145KB)

 Functions




And | ChangeDir | Exec | Exit | FileExists | GetEnvVar | GetFileDialog | GetFolderDialog | GetHostName | GetOSVersion | GetProgramDir | GetProgramDrive | GetRegKey | GetServicePackNumber | GetTmpDir | GetUserName | GetVar | GetWinDir | Not | Null | Or | OsBuild | Reload | SetEnvVar | SetMenuPos | SetVar | Shl | ShowRunDialog | Shr | Ver

 Frequently asked questions


Q: Can I use my own start/go button.
A: Yes, you can. Be sure it is called nu2go.bmp and put it in the same directory as the nu2menu.exe file.

Q: Can I check if a directory exist.
A: Yes, you can. The following example checks if the system32 directory exist.
@FileExists(@GetWinDir()\system32\nul)

Q: Why does the menu item not show up?
A: You probably have an incorrext XML-menu file. See Menu file rules.

Q: How do I position the NU2Menu Go button to stay at the bottom left corner when changing screen resolutions? I have been using PEBuilder v3016 until recently and with that version the Go button stayed in the bottom left corner when I changed resolutions.
A: You can set the menu position with @SetMenuPos( 'L','B' )

Example: <MITEM TYPE="ITEM" DISABLED="@SetMenuPos( 'L','B' )@Not(@FileExists(@GetWinDir()\system32\notepad.exe ))" CMD="RUN" FUNC="@GetWinDir()\system32\notepad.exe" PARM="1">@GetWinDir()\system32\Notepad</MITEM>

 Plans for future versions


Plans for the next release:
[X] Run box
[X] Set your own position of Go/Start button
[X] Add or Change "disable" item, so that an item can be "hidden"
[ ] Input box
[ ] Yes / No box
[ ] Something like onStartup
[ ] Read icons and show them in menu
[ ] Show your own icon for menu item
[ ] Get errorlevel
[ ] Case insens...
View complete list of future plans

 History


2005-11-23 (V0.351)
nu2menu.exe c:\tmp\nu2menu.xml
Can load nu2menu.xml from different location

2005-02-17 (V0.350)
Kinda bug fixed. FileExists did not work with c:\nul

2004-12-01 (V0.349)
New:
Shift bitwise left
@Shl( ValueToShift, HowManyPositions )

Shift bitwise right
@Shr( ValueToShift, HowManyPositions )

@And( ValueToAnd, AndWith )

Changed:
@Or()
@Not()

Menu item sub node DISABLED is replaced by VISIBILITY. 
For backward compatibility the DISABLED node only works...
View complete history

 Used tools/information


Windows and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.


Use information from this site elsewhere? Check our legal information page!
Legal information - [2013-05-20]

Copyright (c) 2000-2013 by Henk de Jong. All rights reserved.