Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP 9000 Networking: Supervising the Network > Chapter 5 Customizing the User Environment

Login Script Commands and Variables

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

This section describes the commands you can use in a login script. The commands are presented in alphabetical order.

Syntax conventions for login script commands, as shown in Table 5-3, are the same as those for workstation text utilities, with one exception: some login script commands must be preceded by the # symbol.

Following is an example of the syntax for the MAP login script command:

MAP [option] drive:=drive:|path

The command syntax is described in Table 5-3.

Table 5-3 Command Syntax Conventions

Convention

Explanation

MAP

Words in uppercase letters are keywords that must be included in the command and spelled exactly as shown. However, it doesn't matter if you type them in uppercase or lowercase letters.

[ ]

Square brackets indicate that the enclosed item is optional.

|

A vertical bar means you can use either the item to the left of the bar or the item to the right, but not both. In the previous MAP example, you can enter either the drive letter or a complete path.

drive

Words in italics are variables. Replace variables with information specific to your task.

[option]

Options or parameters for each command are listed with the command. Options and parameters can often be abbreviated.

<Enter>

Angle brackets indicate a key you should press.

[[ ]]

Nested square brackets indicate that all enclosed items are optional. However, if you use the items within the innermost brackets, you must also use the items within the outer brackets.

 

# (Execute External Program)

Use the # symbol to execute a program that is external to the login script.

Command Format

# [path] filename [parameter]

Replace path with a drive letter; or, if you have specified NOSWAP on the command line or in the login script, you may replace path with a full directory path beginning with the NetWare volume name.

Replace filename with an executable file (files that end in .EXE, .COM, or .BAT, for example). Do not include the extension.

Replace parameter with any parameters that must accompany the executable file.

Using #

If you want the LOGIN utility to execute a program that is external to the login script, enter the # command (symbol) followed by the name of the file you want to execute.

This command fails when

  • The given directory is invalid.

  • Proper security rights are lacking.

  • The executable file cannot be found.

  • Insufficient workstation memory is available to load the file.

    NOTE: LOGIN swaps to extended or expanded memory or to disk unless NOSWAP is specified on the command line or in the login script. NOSWAP prevents LOGIN from being swapped out of conventional memory. Then, if the station does not have enough memory to handle both LOGIN and the # command, the # command fails but the rest of the login script executes normally. For more information, see "SWAP" in this chapter.

Examples

When you want to define a default print queue and printer, you can make the login script execute the NetWare CAPTURE utility. This allows you to send print jobs to a network print queue (named QUEUE_FOR_LASERJET in this example).

If you have a search drive mapped to SYS:PUBLIC where the NetWare utilities are stored, you could enter the following command in the login script:

#CAPTURE Q=QUEUE_FOR_LASERJET NB TI=10 NFF

You do not need to enter a path in this case because CAPTURE is located in a search drive.

If you do not have a search drive mapped to a directory, include the path to that directory in the command. For example, to run a batch file named BATCH.BAT in the ACCOUNTS directory, use the following command:

#Z:\ACCOUNTS\BATCH

Additional Information

For more information about

Refer to

Using the NOSWAP command

"NOSWAP" in this chapter

Using the SWAP command

"SWAP" in this chapter

ATTACH

Use ATTACH to connect to a NetWare 2 or NetWare 3 server or to a NetWare 4 server using bindery services while the login script is running.

Command Format

ATTACH [server[/username[;password]]]

Using ATTACH

Replace server with the name of the NetWare server to which you want to attach.

Replace username with the login name. If you do not include the username, the user is prompted for a login name when the ATTACH command is executed from the login script.

You can replace password with the correct password for that user and server. If the username and password are the same as the primary login username and password, you can omit the password and not be prompted for it.

Use caution when including passwords in a login script, however. It is more secure to eliminate the password. Then, at the point in the login script where the ATTACH command is executed, the user is prompted for the password.

Example

To attach user MRICHARD (whose password is "GOLFING") to a server named REPORTS (which is a bindery-based server running NetWare 3), add the following line to the login script:

ATTACH REPORTS/MRICHARD;GOLFING

BREAK

Use BREAK ON to allow the user to terminate execution of the login script. The default is BREAK OFF.

Command Format

BREAK ON|OFF

Using BREAK

If BREAK ON is included in a login script, you can press <Ctrl>+<C> or <Ctrl>+<Break> to abort the normal execution of your login script.

Including BREAK ON in a login script does not affect the DOS <Ctrl>+<Break> check. For more details, see "DOS BREAK" in this chapter.

When the BREAK option is ON, type-ahead keyboard input is not saved in the buffer.

CLS

Use CLS to clear the display from the workstation's screen during the login process.

Command Format

CLS

Using CLS

When a user logs in, a login script may display messages on the user's workstation screen.

If the CLS command is added to the login script, any messages generated by commands earlier in the login script are cleared from the screen.

COMSPEC

Use COMSPEC in the login script to execute DOS commands from the network. Specify the directory where DOS and the DOS command processor (COMMAND.COM) are loaded.

COMSPEC is originally set when DOS is booted. It must be reset after you log in to change the location that COMMAND.COM loads from while you are logged in to the network.

Command Format

COMSPEC=[path]COMMAND.COM

Replace path with either a drive letter or a full directory path beginning with the NetWare volume name.

Using COMSPEC

Follow these guidelines for using COMSPEC:

  • If users are running DOS from a network directory, first map a search drive in the login script to that directory and then add the COMSPEC command to the login script.

    (You may want to map a fake root to the DOS directory. For information about mapping a fake root, see "MAP" in this chapter.)

  • If all users use the same version of DOS from the network, you can add the COMSPEC command to the container login script.

  • If more than one version of DOS is available on your network, a network directory should exist for each DOS version. In this case, you can put COMSPEC commands in either profile or user login scripts, to make sure each workstation accesses the version of DOS it needs.

  • If users are running DOS from their local drives, do not add COMSPEC to login scripts.

  • To use an environment variable as the value in a COMSPEC command, precede it with the percent sign (%), as follows:

    COMSPEC=%environment variable

CONTEXT

Use CONTEXT to set a user's current context in the Directory tree.

Command Format

CONTEXT context

Using CONTEXT

Replace context with the context you want the user to see after login.

As with the workstation CX utility, you can enter a complete name to move down through the context, or you can use periods to move up toward the Root of the Directory tree.

NOTE: CONTEXT does not support all options that the CX workstation utility does. It only sets the context.

Example

To change the context to the Organizational Unit SALES, under the Organization ACME_US, add the following line to the login script:

CONTEXT .SALES.ACME_US

You can type a single period instead of a container name to indicate that you want to move up one level.

For example, if you are in the context SALES.ACME_US and you want to move up one level to the context ACME_US, add the following line to the login script.

CONTEXT .

To move up two levels, enter two periods, and so on.

Additional Information

For more information about

Refer to

Context

"Context" in Concepts

Using the CX utility

"CX" in Utilities Reference

DISPLAY

Use DISPLAY to show the contents of a text file on a workstation's screen when the user logs in.

This command works best with an ASCII file. If you use DISPLAY with a word-processing file, printer and word-processing codes are displayed with the text.

Command Format

DISPLAY [path] filename

Replace path with either a drive letter or a full directory path beginning with the NetWare volume name.

Replace filename with the complete name (including the extension) of the file you want to display.

Using DISPLAY

When you use DISPLAY to display the contents of a file on the screen, the exact characters in the file, including any printer and word-processing codes, appear on the workstation screen. (To display only the text and suppress codes, use FDISPLAY. See "Using FDISPLAY" in this chapter.)

If the given directory does not exist or the file is not found, no error message appears on the screen when the user logs in.

Example

Suppose you put messages in a file called SYSNEWS.TXT, in the directory SYS:PUBLIC\MESSAGES, and you want your users to see this file on their screens when they log in on Mondays. Add the following lines to the container login script:

IF DAY_OF_WEEK="Monday" THEN
DISPLAY SYS:PUBLIC\MESSAGES\SYSNEWS.TXT
END

DOS BREAK

Use DOS BREAK to set the <Ctrl>+<Break> checking level for DOS.

If DOS BREAK is set to ON, you can terminate a program (other than the login script) by pressing <Ctrl>+<Break>.

NOTE: This command is different from the BREAK command that terminates a login script. For more details, see "BREAK" in this chapter.

Command Format

DOS BREAK [ON|OFF]

Using DOS BREAK

Enter the following command in the login script:

DOS BREAK ON

The default is DOS BREAK OFF.

Additional Information

For more information about

Refer to

Using the DOS BREAK command

Your DOS manual

Using the BREAK login script command

"BREAK" in this chapter

DOS SET

See "SET" in this chapter.

DOS VERIFY

Use DOS VERIFY to verify that data written to a local drive is not written to a bad sector and can be read without an error.

Command Format

DOS VERIFY [ON|OFF]

Using DOS VERIFY

The DOS COPY and NCOPY commands do not automatically verify that data copied to a local drive can be read after the copy.

To assure verification of each copy operation after login, add the VERIFY ON and DOS VERIFY ON commands (for network and DOS copies respectively) to the login script.

Another option, since VERIFY ON can affect performance by slowing down write operations, is to use the /V option at the command line with each COPY or NCOPY operation.

The default in the login script is DOS VERIFY OFF.

These commands may not work with some software that is copy-protected.

DRIVE

Use DRIVE to change the default drive while the login script is executing.

Command Format

DRIVE [drive:|*n:]

Replace drive with a local or network drive letter, or replace n with a drive number. Which one you use depends on what is being assigned within the login script.

Using DRIVE

Unless this command is in your login script, the default drive is set to the first network drive, which is often assigned to your home directory when you log in.

If you don't want the default drive to be the first network drive, map a drive in the login script to the directory you want to be the default; then use the DRIVE command to change the default drive.

Instead of specifying a drive letter, such as F: or G:, you can use an asterisk followed by a number n to represent the nth network drive (for example, *3). This allows drive letters to reorder themselves automatically if previous drive mappings are deleted or added.

Example

Suppose you expect to work on only one project for several days and the files for that project are located on drive S:. You can use the DRIVE command to set your default drive to S: so you won't have to change your default drive manually every time you log in.

First, make sure you have mapped drive S: to the correct directory in your login script. Then enter the following command in the login script:

DRIVE S:

EXIT

Use EXIT to terminate execution of the login script and execute an external program.

Command Format

EXIT ["filename [parameters]"]

Using EXIT

The length of information between quotation marks cannot exceed your keyboard buffer length minus 1 (commonly 15 - 1 = 14 characters).

You can use the EXIT command in a login script to stop the login script and execute a program, such as a word-processing or menu program.

Because EXIT stops the login script, make sure you put this command at the end of the login script.

You can also use EXIT in an IF...THEN statement so that the login script stops and exits to an external program only if a certain condition exists. If the condition doesn't exist, the login script skips the EXIT command and continues executing.

If the program you are executing with the EXIT command requires any DOS paths or NetWare search drives to be set, make sure they are specified in the login script ahead of the EXIT command.

Adding EXIT to a container login script prevents other profile or user login scripts from running. Putting EXIT in a profile login script prevents the user login script from running.

The EXIT command works only on IBM*-compatible workstations running DOS. Therefore, if your DOS workstation has a machine name different from IBM_PC specified in its NET.CFG file, you must add the PCCOMPATIBLE login script command to the login script.

For more information about the PCCOMPATIBLE command, see "PCCOMPATIBLE" in this chapter.

Examples

  • Suppose the workstation's long machine name is IBM_PC. To execute a menu program called TRAINING when the login script is finished, add the following line at the end of the login script:

    EXIT "NMENU TRAINING"
  • If you are using a Hewlett Packard* computer and you have changed the long machine name to HE_PAC in the NET.CFG file, add the following lines at the end of the login script:

    PCCOMPATIBLE
    EXIT "NMENU TRAINING"
  • Suppose you want the login script to exit to a word-processing program when the user logs in on Mondays, but not on other days. You could add the following IF...THEN statement to the login script:

    IF DAY_OF_WEEK="MONDAY" THEN EXIT "WP"

Additional Information

For more information about

Refer to

Changing the machine name in NET.CFG

NetWare Client for DOS/Windows User Guide

Creating a menu

Chapter 6, "Creating Menus"

FDISPLAY

Use FDISPLAY to show the text of a word-processing file on a workstation's screen when the user logs in.

To display both the text and the printer and word-processing codes of a file, or to display an ASCII file, see "DISPLAY" in this chapter.

Command Format

FDISPLAY [path] filename

Replace path with either a drive letter or a full directory path beginning with the NetWare volume name.

Replace filename with the complete name (including the extension) of the file you want to display.

Using FDISPLAY

When you use FDISPLAY to display the contents of a word-processing file on the screen, the text in the file is filtered and formatted so that only the text itself is displayed. FDISPLAY does not display tabs.

If the given directory does not exist or if the file is not found, no error message appears on the screen when the user logs in.

Example

Suppose you put messages in a file called SYSNEWS.TXT, in the directory SYS:PUBLIC\MESSAGES, and you want your users to see this file on their screens when they log in on Mondays.

Add the following lines to the container login script:

IF DAY_OF_WEEK="Monday" THEN
FDISPLAY SYS:PUBLIC\MESSAGES\SYSNEWS.TXT
END

FIRE PHASERS

Use FIRE PHASERS to signal the workstation to emit a phaser sound.

Command Format

FIRE n

Replace n with the number of times you want this sound to occur.

Using FIRE PHASERS

Use this command alone to generate the phaser sound whenever a user logs in. Use FIRE PHASERS with the IF...THEN command to make the sound execute a different number of times depending on the circumstances of the login.

Examples

The following line executes the phaser sound four times upon login:

FIRE 4

To use an environment variable as the number of times to fire, use % before the variable, as follows:

FIRE %environment variable

Either of the following lines fires the phaser five times on Thursdays:

IF DAY_OF_WEEK="Thursday" THEN FIRE 5

or

FIRE %NDAY_OF_WEEK

The identifier variable %NDAY_OF_WEEK indicates a number that corresponds to the day of the week. Since Thursday is the fifth day of the week, phasers fire five times on Thursdays.

For more information about using identifier variables, see "Identifier Variables" on in this chapter.

GOTO

Use GOTO to execute a portion of the login script out of the regular sequence.

Command Format

GOTO label

Use label to indicate where the login script should continue executing.

Using GOTO

Set BREAK ON in your login script before experimenting with GOTO loops so that you can break out of a login script if necessary.

For more information about the BREAK login script command, see "BREAK" in this chapter.

Do not use GOTO to enter or exit a nested IF...THEN statement. This usage confuses the program.

Example

To execute a loop of commands, you could include the following lines in your login script. In this case, the commands to be executed are labeled AGAIN (as indicated in the second line).

SET X="1"
AGAIN:
SET X=<X> + "1"
;see compound strings for this
WRITE <X>
IF <X> < "9" THEN GOTO AGAIN

The GOTO command looks at the value of <X> (a DOS environment variable). If the value of <X> is less than 9, then <X> increments by 1 and GOTO loops back to the AGAIN label. When <X> gains the value of 9, the IF...THEN test becomes false, the GOTO is ignored, and the script continues normally. See the IF...THEN command next.

IF...THEN...

Use ... IF...THEN when you want the login script to perform an action only under certain conditions.

Command Format

IF conditional [AND|OR [conditional]] THEN
commands
[ELSE
command]
[END]

......Replace conditional with identifier variables. For more information about identifier variables, see "Identifier Variables" in this chapter.

Replace commands with any login script commands that you want to be executed if the specified condition is true.

Using IF...THEN

Follow these guidelines for using IF...THEN:

  • Use IF...THEN statements to execute commands only under certain conditions.

    An example of a conditional statement is

    IF MEMBER OF "CLERKS"

    In this statement, some action is performed if the user who logged in belongs to the Group object named CLERKS.

    The following is a different type of conditional statement:

    IF DAY_OF_WEEK="MONDAY"

    In this statement, the equals sign (=) indicates the relationship between the variable (DAY_OF_WEEK) and its value (Monday). Note that the value (Monday) is inside quotation marks.

  • When using IF...THEN statements, be aware of the following syntax rules:

    • Use AND or OR to include two or more conditionals in an IF...THEN statement.

    • Values of conditional statements must be enclosed in quotation marks.

    • The ELSE statement is optional.

    • IF, ELSE, and END must be on separate lines. THEN does not need to be on a separate line.

    • If you include a WRITE command as part of the IF...THEN command, the WRITE command must be on a separate line.

    • IF...THEN statements can be nested (up to 10 levels). However, GOTO should not be used in a nested IF...THEN statement to enter or exit from the body of an IF...THEN statement.

    • If your IF...THEN statement consists of only one line, even if that line wraps, you do not need to include END. If your IF...THEN statement must be on more than one line (for example, you used ELSE or WRITE, which must be on separate lines), you must include END.

Six relationships are possible between the elements of an IF...THEN statement. Represent these relationships with the following symbols:

Symbol

Definition

=

Equals

<>

Does not equal

>

Is greater than

>=

Is greater than or equal to

<

Is less than

<=

Is less than or equal to

Examples

  • If you place the following command in a login script, the message "Status report is due today" appears when the user logs in on Monday and "Have a nice day!" on other days.

    IF DAY_OF_WEEK="MONDAY" THEN
    WRITE "Status report is due today"
    ELSE
    WRITE "Have a nice day!"
    END
  • The following line means "If the hour (on a 24-hour scale) is greater than or equal to 12, then write 'afternoon'."

    IF HOUR24>="12" THEN
    WRITE "afternoon"
    END
  • The following command executes the CAPTURE utility on the fourth day of the week (Wednesday):

    IF NDAY_OF_WEEK="4" THEN
    #CAPTURE Q=FAST_Q NB TI=10 NFF
    END
  • The following example shows nested IF...THEN statements. Notice that there are two IF statements, so each one must have its own END statement.

    IF DAY_OF_WEEK="MONDAY" THEN
    MAP *6:=VOL1:APPL\WP
    IF MEMBER OF CLERKS THEN
    WRITE "Your report is due immediately!"
    END
    END
  • Conditionals can be joined with commas, the word AND, or the word OR to form compound conditionals.

    The first line of the following IF...THEN statement is a compound conditional that means "If it is the evening of the first day of the month":

    IF GREETING_TIME="EVENING" AND DAY="01" THEN
    WRITE "The system will be backed up tonight."
    END

    The following line is a compound conditional that means "If it is 11:59:59 p.m.":

    IF HOUR24="23" AND MINUTE="59" AND SECOND="59"
  • An IF...THEN statement can include several commands that must be executed if the conditional is true.

    The following example shows two commands that are executed on Tuesdays: a WRITE command that displays a message about a staff meeting, and an INCLUDE command that tells the login script to process any commands or messages contained in the file SYS:PUBLIC\uPDATE.

    IF DAY_OF_WEEK="TUESDAY" THEN
    WRITE "Staff meeting today at 10 a.m."
    INCLUDE SYS:PUBLIC\uPDATE
    END

Additional Information

For more information about

Refer to

Using identifier variables

"Identifier Variables" in this chapter

Using the WRITE login script command to display messages

"WRITE" in this chapter

INCLUDE

Use INCLUDE to execute independent files or another object's login script as a part of the login script currently being processed.

These subscripts can be text files that contain valid login script commands (any of the commands explained in this section) or login scripts that belong to a different object you have rights to.

Command Format

INCLUDE [path]filename

or

INCLUDE object_name

To use a text file as a subscript, replace path with either a drive letter or a full directory path beginning with the NetWare volume name.

Replace filename with the complete name (including the extension) of the text file.

To execute another object's login script as part of a login script, replace object_name with the name of the object whose login script you want to use.

Using INCLUDE

Text files that contain login script commands and other object's login scripts can be used as subscripts. Use these subscripts to supplement the main login script.

You can create and edit text file subscripts using any text editor. Subscripts do not have to have any particular filenames or extensions.

The INCLUDE command executes the login script commands contained in the subscript. It does not display the text of the subscripts.

INCLUDE nesting is limited only by available memory. This means that one subscript file can include another subscript file, which can include yet another subscript file, and so on.

If the subscript is a text file, users must have at least File Scan and Read rights to the directory containing the subscript.

If you are using another object's login script as a subscript, users must have the Browse right to the object whose script you are including and the Read right to the object's Login Script property.

Examples

  • To execute a text file called SCRIPT.NEW (located in the VOL1: volume) as a subscript, add the following line to your main login script:

    INCLUDE VOL1:ADMIN\uSERS\SCRIPT.NEW
  • Suppose you are creating a container login script for all users under the Organizational Unit object SALES_LA. You recently created a container login script for users under the Organizational Unit object SALES_PV.

    Now you've decided that the login scripts for the two different groups of users are very similar. In fact, you decide that the SALES_LA users could use the same login script as the SALES_PV users, but with a few more drive mappings.

    In the SALES_LA login script, you could add the additional drive mappings, and then use the INCLUDE command to execute the entire SALES_PV login script as a part of the SALES_LA login script, as follows:

    • Create an alias for the SALES_PV Organizational Unit in the SALES_LA Organizational Unit.

    • Add this line to the SALES_LA Organizational Unit's login script.

      INCLUDE .SALES_PV_ALIAS.SALES.ACME_US

    Figure 5-2 illustrates how the INCLUDE command executes the SALES_PV login script as part of the SALES_LA login script.

    Figure 5-2 Using INCLUDE in a Login Script

    Using INCLUDE in a Login Script

LASTLOGINTIME

Use LASTLOGINTIME to display the last time the user logged in.

Command Format

LASTLOGINTIME

Using LASTLOGINTIME

If you include this command in your login script, the time of the last login is displayed on the user's workstation screen.

MACHINE

Use MACHINE to set the DOS machine name (such as IBM or EDIT_ROOM) of the workstation. The MACHINE command is necessary for some programs (such as NETBIOS) written to run under PC DOS.

Do not confuse the MACHINE command with the identifier of the same name. The identifier is used with a preceding percent (%) sign in MAP and WRITE statements. The identifier reads its value from the NET.CFG file.

It is unlikely that you will need to use this command. However, it is provided in case you come upon a program that requires it.

Command Format

MACHINE=name

Using MACHINE

The machine name can be up to 15 characters. (Longer machine names are truncated to 15 characters.)

For example, to specify that the machine name is IBM_PS2, add the following line to the login script:

MACHINE=IBM_PS2

Additional Information

For more information about

Refer to

Setting machine names in the NET.CFG file

NetWare Client for DOS/Windows User Guide

Using identifier variables

"Identifier Variables" in this chapter

MAP

Use MAP to map drives and search drives to network directories.

Command Format

MAP [option] [drive:=path]

Replace drive with any valid network drive letter, local drive letter, or search drive number.

Replace path with a drive letter, a full directory path, or a Directory Map object.

More than one command can be on the map line if the commands are separated by a semicolon (;), as shown in the following example:

MAP *1:=SYS:PUBLIC;*2:=SYS:PUBLIC\DOS

When mapping a drive to a directory on an NDS server, begin the path with either the Volume object name or server/volume.

When mapping to a directory on a bindery-based server or to an NDS server that isn't your current server, begin the path with the server's name.

Replace option with one of the following:

  • DISPLAY ON/OFF: Determines whether drive mappings are displayed on the screen when the user logs in. The default setting is ON. This option is valid only in login scripts.

  • ERRORS ON/OFF: Determines whether MAP error messages are displayed when the user logs in. MAP ERROR OFF must be placed before MAP commands in the login script. The default setting is ON. This option is valid only in login scripts.

  • INS: Inserts a drive mapping between existing search mappings. This option is valid in login scripts and at the DOS command line.

  • DEL: Deletes a drive mapping, making that drive letter available for other mapping assignments. This option is valid in login scripts and at the command line.

  • ROOT: Maps a fake root. Some applications require their executable files to be located in a root directory.

    Since you may not want users to have rights at the root directory, you can map a fake root to a subdirectory instead. This option is valid in login scripts and at the command line.

  • C (CHANGE): Changes a search drive mapping to a regular mapping and a regular mapping to a search drive mapping. This option is valid in login scripts and at the command line.

  • NP (No prompt): When a MAP command conflicts with an existing drive mapping, MAP NP eliminates the prompt that asks the user if the new drive mapping should overwrite the old mapping.

    This option is valid only at the command line.

  • P (Physical): Maps a drive to the physical volume of a server rather than to the Volume object's name.

    It is possible to have a Volume object name that conflicts with a physical volume name. (For example, object ACCT is an Accounting volume, but there is also an ACCT which is a physical volume.)

    Therefore, if you prefer to map a drive to the physical volume name, use MAP P. This option is valid in login scripts and at the command line.

  • N (Next): When used without specifying a drive number or letter, maps the next available drive. This option is valid in login scripts and at the command line.

Using MAP

Follow these guidelines when using MAP:

  • If you use MAP to automate drive map assignments during execution of the login script, users don't have to map drives manually every time they log in.

  • Specify drive mappings in a login script by entering the same commands that you would enter if you were using MAP at the command line.

  • To avoid having the result of each mapping displayed as it is executed, you can put the MAP DISPLAY OFF command at the beginning of your login script. When all drive map assignments have been completed, add the line MAP DISPLAY ON and MAP to your login script. This sequence provides a cleaner display for the users as they log in.

  • Instead of specifying drive letters such as F: or G:, you could use an asterisk followed by a number n to represent the nth network drive. For example, if your first network drive is F: then using MAP *3:= would assign H:, or if your first network drive is D: then using MAP *4:= would assign G:.

    This allows drive letters to reorder themselves automatically when local drives are removed or added or when the first network drive is changed.

    This also allows users to log in from workstations that have a different number of local drives than their regular workstation.

  • You can map a local drive (usually A: through C:) to a network directory, but you cannot access the local drive until you remove the network drive mapping.

  • You must not map a redirected drive, such as a CD-ROM drive, to a network drive.

  • In many cases, you might find it useful to map network drives in the following order:

    • Map the first network drive to the user's home directory.

    • If users are running Windows from the network, map a drive to each user's directory that contains user-specific files.

    • Map remaining drives to any directories in which users frequently work, such as project directories.

Mapping Search Drives

For DOS and Windows workstations, you can map search drives to directories that contain applications, executable files, and so forth. Then users can execute those applications regardless of the directory in which they are currently working.

A maximum of 16 NetWare search drives is allowed.

NOTE: Any object names in the login script should either be in the user's context or should have an alias point to the real object in another context. Any object referenced by a name outside the user's context will not work when that object is moved or renamed or the context is renamed. See "Alias object" in Concepts.

When you map a search drive, use a search drive number (an S followed by a number). This search drive number assigns the next available drive letter to the mapping, starting with Z and working backwards through the English alphabet.

The letter assigned to the search drive is put into the DOS path statement. If you already have search drives in the path statement, the command MAP S1:= will overwrite the first one in the path. To prevent search drive assignments from overriding existing DOS PATH letters, use the INSERT option when assigning search drives. For example, type

MAP INS S16:=path

To ensure that users can access NetWare utilities, DOS directories, and applications, we recommend you map search drives to these directories in the following order:

  • Map the first search drive (S1:) to the SYS:PUBLIC directory, which contains the NetWare utilities for DOS and Windows workstations.

  • Map the second search drive (S2:) to the DOS directory if users access DOS from the network.

  • Map the third and subsequent search drives (S3:, S4:, etc.) to directories containing applications and the electronic NetWare documentation.

  • If your users are running Windows from the network, map a search drive to the Windows directory for the Windows group.

To avoid inadvertently changing the order of any search drives that must be mapped to a specific drive letter, you can map all remaining search drives with the number S16:, which assigns the next lowest search number each time it is used.

This command assigns the next available drive letter to the search drive without displacing the previous search drives.

If you have an application that requires a particular drive letter, you can use the following command to map the search drive, replacing drive with the drive letter:

MAP S16:=drive:=path

If you map a search drive using a number already assigned to a search drive, NetWare makes the old search drive a network drive. The letter assigned to the old search drive remains assigned as the converted drive mapping. The new search drive takes the next unused letter of the alphabet.

Mapping Drives to Directory Map Objects

Another way to map a drive to a directory is to create a Directory Map object that points to the directory. Then, if you move the directory, you only need to change the Directory Map object rather than all of the login scripts that may include that mapping.

NOTE: It is best to use Directory Map objects in the user's current context. Do not use complete names that point to other contexts. If the map is in another context, you should create an alias that points to the real Directory Map object.

See "Alias object" in Concepts.

For example, to map a search drive to a Directory Map object whose complete name is APPL.SALES_LA.ACME_US, add the following line to the login script:

MAP S2:=.APPL.SALES_LA.ACME_US

In the previous example, the Directory Map object's name begins with a period, which indicates that the drive is mapped to the drive Root.

If the user whose login script this line appears in is also located in the SALES_LA.ACME_US context, the MAP command does not have to specify the Directory Map object's complete name. Instead, the line would be

MAP S2:=APPL

For more information about using Directory Map objects, see "Loading Operating Systems and Applications onto the Network" in chapter 3.

Examples

  • To map the first search drive to the SYS:PUBLIC directory (which contains the NetWare utilities for DOS and Windows workstations) add the following line to the login script:

    MAP S1:=SYS:PUBLIC

    The second search drive should be mapped to the DOS directory if users run DOS from the network.

  • If your network has more than one DOS directory, use variables to indicate the directory path. These variables are replaced by the correct information from the workstation software when each user logs in.

    To use variables for the DOS directory path, enter the following command in the login script:

    MAP S2:=SYS:PUBLIC\%MACHINE\%OS\%OS_VERSION
  • If all users have the same types of computers and are using the same version of DOS, you probably have only one DOS directory. In this case, add a line similar to the following, substituting the correct directory names:

    MAP S2:=SYS:PUBLIC\IBM_PC\MSDOS\50

    You can also create a Directory Map object that points to the DOS directory, then map the search drive to the Directory Map object.

    For more information about creating DOS directories, see "Loading Operating Systems and Applications onto the Network" in chapter 3.

  • To map the next available search drive to the SYS:APPL\WORDPROC directory, add the following line to the login script:

    MAP S16:=SYS:APPL\WORDPROC

    If you have mapped a Directory Map object to this directory, you can substitute the Directory Map object's name for the directory path.

    For example, suppose you created a Directory Map object called WPROC, which is located in the context SALES.ACME_US, and mapped that object to the SYS:APPL\WORDPROC directory.

    Following the rule of no complete names in a login script, you would create an alias in your own context to the object in .SALES.ACME_US. Then use the following line in your login script:

    MAP S16:=WPROC
  • Suppose an application in the FORM directory requires that it reside in the Root directory of drive P:, but you don't want to put the application in the Root directory for security reasons.

    You can map a fake root to the directory and map a search drive to it at the same time by adding the following line to the login script:

    MAP ROOT S16:=P:=SYS:APPL\FORM
  • To map Richard's first four regular drive mappings to his home directory, the SYS:PUBLIC\OS2 directory (which contains the NetWare utilities for OS/2), the REPORTS directory, and the PROJECTS directory, add the following four lines to Richard's user login script:

    MAP *1:=VOL1:HOME\RICHARD
    MAP *2:=SYS:PUBLIC\OS2
    MAP *3:=VOL1:ACCOUNTS\REPORTS
    MAP *4:=VOL1:UPDATES\PROJECTS

    To map Richard's fifth drive to the PUBLIC directory on a NetWare 3.11 server named FS1, you need to include the server name in the MAP command. Use the following line in your login script:

    MAP *5:=FS1\SYS:PUBLIC
  • If you are mapping a drive to a directory that is located on a volume within your current context, include the volume's common name in the MAP command, as demonstrated in the previous examples.

    If you are mapping a drive to a volume that is not in your current context, first create an alias to that volume; then include the volume's common name in the MAP command.

    For example, if the complete name of a volume not in your current context is VOL1.SALES.ACME_US, then create an alias named VOL1: to that volume. The MAP command would include only this common name.

    To map a drive to the APPL directory in this volume, the line in the login script would be

    MAP *6:=VOL1:APPL

Additional Information

For more information about

Refer to

Drive mappings

"Drive mapping" in Concepts

Enabling users to run DOS from the network

"Loading DOS onto the Network" in chapter 3

Using Directory Map objects

"Loading Operating Systems and Applications onto the Network" in chapter 3

NO_DEFAULT

Use NO_DEFAULT in a container or profile login script if you do not want the default user login script to run.

Command Format

NO_DEFAULT

Using NO_DEFAULT

If you do not want to create any user login scripts, and you do not want the default user login script to run, add this command to either the container or the profile login script.

If you have created a user login script for someone, that login script executes whether or not the NO_DEFAULT command is in the container or profile login script.

NOSWAP

Use NOSWAP to prevent the LOGIN utility from being moved out of conventional memory into higher memory (if available) or onto the disk to execute a # command and LOGIN at the same time.

Command Format

NOSWAP

Using NOSWAP

LOGIN always swaps to extended or expanded memory unless NOSWAP is specified on the command line or in the login script.

If you do not want LOGIN to be temporarily stored in higher memory or on the workstation's disk, use the NOSWAP command. NOSWAP prevents LOGIN from being swapped out of conventional memory.

Then, if the workstation does not have enough memory to handle both LOGIN and the # command, the # command fails but the rest of the login script executes as usual.

If you want LOGIN to be swapped out of conventional memory immediately every time a # command is executed, place the SWAP command in the login script before the # command.

Additional Information

For more information about

Refer to

Using the # command

"# (Execute External Program)" in this chapter

Using the SWAP command

"SWAP" in this chapter

PAUSE

Use PAUSE to create a pause in the execution of the login script.

Command Format

PAUSE

Using PAUSE

Enter this command in your login script at any point you want a pause to occur.

You can add PAUSE to the login script following a message so that the user has time to read the message before it scrolls off the screen.

If you include PAUSE, the message "Strike any key when ready..." appears on the workstation screen. The LOGIN utility then waits for a key to be pressed before it executes the rest of the login script.

PCCOMPATIBLE

Use PCCOMPATIBLE to enable the EXIT "command" login script command to work if your workstation's LONG MACHINE NAME is not IBM_PC.

Command Format

PCCOMPATIBLE

Using PCCOMPATIBLE

If your computer is an IBM PC compatible machine and not an IBM PC, use PCCOMPATIBLE in your login script to inform the LOGIN utility that your machine's long name is something other than IBM_PC. The LONG MACHINE NAME (AT&T, COMPAQ, or others) must be included in the NET.CFG file.

Place the following anywhere before EXIT in the login script:

PCCOMPATIBLE

Example

If you have a Hewlett Packard computer and you have changed the LONG MACHINE NAME to HE_PAC in the NET.CFG file, and you want to exit to NETADMIN from within your login script, put the following commands in your login script:

PCCOMPATIBLE
EXIT "NETADMIN"

Additional Information

For more information about

Refer to

Setting the machine name in NET.CFG

NetWare Client for DOS/Windows User Guide

Using the EXIT command

"EXIT" in this chapter

PROFILE

Use PROFILE in a container script to set or override a user's assigned or command-line-specified profile script. It is useful when defining a group profile.

Command Format

PROFILE profile_object_name

Example

To override the profile script assigned to a user or specified at the command line and cause the user to execute a PROFILE script called team_profile, use the following command:

PROFILE team_profile

REMARK

Use REMARK to insert explanatory text into your login script. This text does not display on the screen.

Command Format

REM[ARK] [text]

or

* [text]

or

; [text]

Replace text with the comment you want to include in the login script.

Using REMARK

Follow these guidelines for using REMARK:

  • To include explanatory text in your login script, begin a line with REMARK, REM, an asterisk (*), or a semicolon (;).

  • Any text that follows these symbols is ignored when the LOGIN command executes your login script. Remarks do not appear on the screen.

  • Using remarks in your login script can make the script much easier for you or other users to read and understand.

  • The REMARK command and its associated text must be the only entry on a line. Placing remarks on the same line as other login script commands can cause errors.

  • If a remark is several lines long, begin each line with the remark keyword (REMARK, REM, an asterisk, or a semicolon).

Example

The following are examples of explanatory text that you might use with the REMARK command and its variants:

* This is Richard's login script
; Mapped network drives follow:
REM The next mapping is a fake root.
REMARK This login script is for new users.

SCRIPT_SERVER

Use SCRIPT_SERVER to set a home server from where the bindery login script is read.

NOTE: The SCRIPT_SERVER command is for NetWare 2 and NetWare 3 users and has no effect on NetWare 4 users.

Command Format

SCRIPT_SERVER server_name

Using SCRIPT_SERVER

This command has no effect on NetWare Directory Services™. See your NetWare 2 or NetWare 3 documentation for information about SCRIPT_SERVER.

SET

Use SET to set a DOS environment variable to a specified value.

Command Format

[TEMP] SET name="value"

Replace name with an environment parameter that identifies the environment you want to change.

Replace value with identifier variable substitutions. Values must be enclosed in quotation marks.

To change the environment for the login script, but not for the workstation after the login script has finished executing, use the optional keyword TEMP.

Using SET

Use the SET login script command the same way you use the DOS command SET. However, when you use SET in a login script, you must enter quotation marks (" ") around values.

NOTE: If a variable is set to a path that ends in a \", these two characters are interpreted as an embedded quotation mark preceded by an escape character. To avoid this problem, use two backslashes before the ending double quotation marks (\\").

The SET commands do not have to be included in login scripts.

For example, you may decide that it is easier to put some SET commands in the workstation's AUTOEXEC.BAT file. Where you use SET commands depends upon your individual needs.

NOTE: This command does not work in a login script if the DOS workstation's environment is too small. In this case, you should set the environment size in the CONFIG.SYS file.

See the SHELL command in your DOS manual for more information about the environment size.

After you use the SET command to set a value for an environment variable, you can use that variable in other login script commands.

To include an environment variable as an identifier variable in a command, enclose the name of the variable in angle brackets, for example, <emailuser>.

Examples

  • You can use SET to make a prompt display the current directory path, such as F:\HOME\MARY>, rather than just the drive letter. To do this, add the following line to the login script:

    SET PROMPT="$P$G"

    "$P" lists the current directory path; "$G" displays a ">" (greater than) character. See your DOS manual for more information.

  • To set a path for a program called DAILY, which is in the REPORTS subdirectory beneath drive G:, you would add the following line:

    SET PATH="G:\REPORTS\DAILY"

    This sets the variable PATH to G:\REPORTS\DAILY.

    NOTE: Setting the variable PATH in the login script removes any search drives previously assigned. Use SET PATH only before you map search drives. SET PATH also overwrites any paths set in the user's AUTOEXEC.BAT file.

    To display this path, you can include PATH as an identifier variable in a WRITE command by enclosing the variable (not the value) in angle brackets. For example, the following line displays "My path is G:\REPORTS\DAILY."

    WRITE "My path is "%<path>
  • To include an environment variable in a MAP command, precede the variable with a percent sign (%).

    For example, you could include the following lines in a login script to set and map a drive to the variable NWS:

    SET NWS="C:\XYZ"
    MAP S16:=%<NWS>

Additional Information

For more information about

Refer to

Using environment variables as identifier variables in other login script commands

"Identifier Variables" in this chapter

Using the SET command

Your DOS manual

SET_TIME

Use SET_TIME to set the workstation time equal to the time on the NetWare server to which the workstation first connects.

Command Format

SET_TIME ON|OFF

Using SET TIME

The default value is SET_TIME ON, which means the workstation time is set to the NetWare server time whenever the user logs in. If you include SET_TIME OFF in the login script, the workstation time does not update to the server's time.

SHIFT

Use SHIFT to change the order in which %n identifier variables are interpreted in the login script. The SHIFT command allows users to enter LOGIN parameters in any order.

Command Format

SHIFT [n]

Replace n with the number of places you want the variable to shift. The default is SHIFT 1.

Using SHIFT

You can shift up to 10 arguments.

When users execute LOGIN, they can include additional parameters. Each of these parameters is assigned a %n variable; in this way, the parameter's real value can be substituted for the %n variable that appears in the login script.

In the login script, you can add SHIFT with a positive or negative number to move the variables in either direction. For example, SHIFT -3 moves each %n variable three positions to the left.

Example

When Mary logs in, she wants to access her word-processing program, change the way it is set up, and map a drive to her work directory called ACCNTS.

Mary also has a command in her login script to map a drive to her LOTUS directory, but she does not need it today. The commands in Mary's login script are shown here.

LOOP
IF "%2"="WP" THEN 
SET WP="\u-CML\B-10\D"
MAP S16:=SYS:APPL\WP\SETUP
IF "%2"="ACCNTS" THEN
MAP G:=SYS:ACCNTS
IF "%2"="LOTUS" THEN
MAP S16:=SYS:APPL\LOTUS
SHIFT
IF "%2"<>"" THEN GOTO LOOP

(In the last line, "IF "%2" < >" is followed by closed quotation marks, which means "If %2 isn't blank".)

With these commands in her login script, Mary can log in to the primary file server (named FS1) using her username, MARY, as follows:

LOGIN FS1\MARY WP ACCNTS

The parameters in Mary's LOGIN command are given the following values:

%0=FS1

%1=MARY

%2=WP

%3=ACCNTS

Mary's login script looks for %2, which is WP, and sets the word-processing environment. Then the login script shifts the variables one to the right so that %2 now becomes ACCNTS. Upon executing the loop, the login script maps a drive to the ACCNTS directory.

Mary could also change the order of her LOGIN command without affecting the way her work environment is set up, as follows:

LOGIN MARY ACCNTS WP

The parameters in this LOGIN command are given the following values:

%0=FS1

%1=MARY

%2=ACCNTS

%3=WP

In this case, Mary's login script looks for %2, which is now ACCNTS.

The login script maps a drive to the ACCNTS directory. Then the login script shifts the variables to the right so that %2 now becomes WP.

Upon executing the loop, the login script sets the word-processing environment.

Additional Information

For more information about

Refer to

Using %n variables in login scripts

"Using LOGIN Parameters with %n Variables" in this chapter.

SWAP

Use SWAP to move the LOGIN utility out of conventional memory into higher memory (if available) or onto the disk. This allows execution of a # command and LOGIN at the same time.

Command Format

SWAP [path]

You can replace path with either a drive letter or a full directory path beginning with the NetWare volume name.

Using SWAP

By default, the LOGIN utility always swaps to extended or expanded memory, unless NOSWAP is specified on the command line or in the login script.

NOTE: The SWAP option does not work with the DR DOS 6.0 EMM386 Memory Manager option unless upper memory is disabled.

If you specify a path in the SWAP command, LOGIN swaps into the directory you specified. If the directory specified in that path does not exist or if you do not have rights there, LOGIN prompts you for another path.

If you do not specify a path, LOGIN swaps either into higher memory (if available) or to the current drive. If LOGIN tries to swap to the current drive and you don't have rights to the current drive, LOGIN prompts you for a path to use. If you specify a valid path, LOGIN always swaps to the specified path.

Then, if the workstation does not have enough memory to handle both LOGIN and the # command, the # command fails but the rest of the login script executes as usual.

Additional Information

For more information about

Refer to

Using the # command

"# (Execute External Program)" in this chapter

Using the NOSWAP command

"NOSWAP" in this chapter

TEMP SET

Use TEMP SET to change the environment for the login script, but not for the workstation after the login script has finished executing.

See "SET" in this chapter.

WRITE

Use WRITE to display messages on the workstation screen when a user logs in.

Command Format

WRITE "[text][%identifier]" [;][identifier]

Replace text with the words you want to display on the screen.

Replace identifier with a variable you want to display, such as a user's login name. (See "Using Identifier Variables" in this chapter for a complete list of variables.)

Using WRITE

Text you want to display must be enclosed in quotation marks (" ").

There are several ways to display variables in the text message. The way you enter the variable in the WRITE command determines the display format, as follows:

  • If you type the identifier variable exactly as shown, with no special punctuation, only the variable is displayed on the screen. (See "Login Script Identifier Variables" in Table 5-6.)

  • If you enclose the identifier variable inside quotation marks, then precede the variable by typing a percent sign (%) and type the text in uppercase letters, both the variable and the text are displayed on the screen.

    This method is often used to combine regular text with an identifier variable because both the text and the variable can be enclosed in the same quotation marks.

To join several text strings and identifier variables into a single display without enclosing the variables in quotation marks, use a semicolon between the text and the variables.

If you have several WRITE commands, each one appears on a separate line on your workstation. However, if you put a semicolon at the end of all but the last WRITE command, the commands appear as one continuous sentence or paragraph (although they may wrap onto additional lines on the workstation's screen).

Text strings can include the special characters in Table 5-4:

Table 5-4 Text String Characters

Character

Meaning

\r

Makes a carriage return occur

\n

Starts a new line of the text

\"

Displays a quotation mark on the screen

\7

Makes a beep sound

 

In addition to the semicolon, there are other operators you can use to form compound strings (in other words, to join text and identifier variables into one command). These operators are listed in Table 5-5 in order of precedence.

Table 5-5 Text and Identifier String Operators

Operator

Meaning

* / %

Multiply, divide, modulos

+ -

Add, subtract

>> <<

Shift left or right (1000 >> 3 becomes 1)

 

Examples

  • To display the message "Hello," add the following line to the login script:

    WRITE "Hello"
  • To display the user's last name (surname) along with a greeting, add the identifier LAST_NAME to the command. To do this, either join the text and the identifier with a semicolon or include the variable in the quotation marks with the text.

    Either of the following lines displays "Hello, Smith" when user Bob Smith logs in:

    WRITE "Hello, ";%LAST_NAME
    WRITE "Hello, %LAST_NAME"
  • To make a beep sound occur while the phrase "Good morning" appears on the screen, add the following line to the login script:

    WRITE "Good %GREETING_TIME \7"
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1996 Hewlett-Packard Development Company, L.P.