Drive Image Backup Software
Disk Imaging utility for Windows
and DOS. Free 30 day trial!
Sponsored link: from ALWIL Software: avast! BART CD 2.0

Print Sponsor Nu2 Search Nu2 About Henk Support Henk Contact Henk

Nu2Menu, functions help

TipNU2 TIP: Click here to Fix Windows Errors & Optimize Windows Performance

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

@FunctionName - > short explanation of function
Parameternumber (type of parameter) : short explanation of parameter
[Parm] optional parameter


@And() -> Logical And function
Parm1 (string) : numeric string value
Parm2 (string) : numeric string value
returns: numeric string value


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


@Exec() -> Executes file
Parm1 (string) : filename to execute
[Parm2] (number) : show parameter, default is 1
returns: have to check (HDJ)

Show parameter should be one of the following:
0 - hide window
1 - show window normal
2 - show window minimized
3 - show window maximized
4 - show window, window not activated
5 - show window
6 - show window minimized, activates next top level window in z-order
7 - show window minimized, window is not activated
8 - show window, window is not activated
9 - activates and displays the window. if the window is minimized or maximized, the system restores it to its original size and position
10 - show default
11 - force minimize (2000/XP/PE only, minimizes a window, even if the thread that owns the window is hung)

Start notepad maximized
@Exec( @GetWinDir()\system32\notepad.exe, 3 )

Start command in 'normal' window
@Exec( 'cmd.exe',1 )

Not all applications respond on the show parameters and some parameters doesn't do anything under WinPE. They are only included for the sake of completeness.
For example, calc.exe (Calculator) cannot be started maximized.


@Exit() -> function for shutting down nu2menu


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

@FileExists( @GetWinDir()\system32\notepad.exe )
@FileExists( 'c:\windows\system32\cabview.dll' )


@GetEnvVar() -> Get environment variable
Parm1 (string) : name of environment variable
returns: the value of the requested environment variable

@GetEnvVar( 'ComSpec' )


@GetFileDialog() -> Get file dialog and returns file name

@GetFileDialog( 'xml',' ','nu2menu file (.xml)|*.xml|All Files (*.*)|*.*||' )


@GetFolderDialog() -> Get folder dialog and returns folder name


@GetHostName() -> Get computer/host name


@GetOSversion() -> Get operating system version (major and minor version), e.g. '1.0'


@GetProgramDir() -> Returns the nu2menu.exe's program directory, like "c:\nu2menu"


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


@GetRegKey() -> Get registry key value
Parm1 (string) : RootKey, this can be one of the following:
Parm2 (string) : Subkey, name of sub key
Parm3 (string) : KeyName, name of key to read
Parm4 (string) : KeyType, this can be one of the following:
    REG_SZ -> String
    REG_EXPAND_SZ -> expandable string
    REG_BINARY -> Binary

Example: Get PE-Builder Version
@GetRegKey( 'HKLM', 'SYSTEM\CurrentControlSet\Control\PE Builder', 'Version', 'REG_SZ' )


@GetServicePackNumber() -> Get service pack number (major and minor version), e.g. '5.1'


@GetTmpDir() -> Returns the path of the directory designated for temporary files


@GetUserName() -> Returns username


@GetVar() -> Get global variable


@GetWinDir() -> Returns the windows directory, like "c:\windows"


@Not() -> logical not function
returns: numeric string value
Not, 0->1, 1->0


@Null() -> redirect output to null device


@Or() -> logical or function
Parm1 (string) : numeric string value
Parm2 (string) : numeric string value
returns: numeric string value


@OsBuild() -> returns OS build number


@Reload() -> Reload menu as a function
returns: nothing


@SetEnvVar() -> Set environment variable


@SetMenuPos() -> Set menu position
Parm1 (string) : XPos = x position, can also be 'R' for right, 'L' for left or 'C' for center
Parm2 (string) : YPos = y position, can also be 'T' for top, 'B' for bottom or 'C' for center
returns: nothing

Example 1: @SetMenuPos( '100','400' )
Example 2: Set menu position to the top right corner
@SetMenuPos( 'R','T' )


@SetVar() -> Set global variable, so you can use anywhere else in the menu system


@Shl() -> Shift bitwise left
Parm1 (string) : ValueToShift
Parm2 (String) : HowManyPositions
returns: shifted value

Example: The following example hides the menu item if notepad.exe is not found in the system32 directory
<MITEM TYPE="ITEM" VISIBILITY="@Shl(@Not(@FileExists( @GetWinDir()\system32\notepad.exe )),'1')" CMD="RUN" FUNC="@GetWinDir()\system32\notepad.exe" PARM="1">@GetWinDir()\system32\Notepad</MITEM>


@ShowRunDialog - > Show the default windows run dialog. (thanks to Cyberian)


@Shr() -> Shift bitwise right
Parm1 (string) : ValueToShift
Parm2 (String) : HowManyPositions
returns: shifted value


@Ver() -> Displays version of nu2menu

Use information from this site elsewhere? Check our legal information page!
Legal information - [2015-11-30]

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