Login Script Commands and Variables

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 16, 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 <Enter>

The command syntax is described in the table.


Table 16. 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 this command (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


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 See

Using the NOSWAP command

NOSWAP

Using the SWAP command

SWAP


ATTACH

Use ATTACH to connect to a bindery-based NetWare server (NetWare 2 or NetWare 3), 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 her 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

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

To execute DOS commands from the network, use COMSPEC in the login script. 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're in the network.

IMPORTANT:  Users running virtual DOS sessions under OS/2 should not use this command in the login script. For more information, see Using COMSPEC with OS/2


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


Using COMSPEC with OS/2

For information about accessing the correct version of DOS from OS/2, see IntranetWare Client for OS/2 User Guide.


CONTEXT

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


Command Format

CONTEXT context


Using CONTEXT

To change the current Directory tree context, replace context with the context you want the user to see after login.

Similarly to 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 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 NOVELL_US, add the following line to the login script:

CONTEXT .SALES.NOVELL_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.NOVELL_US and you want to move up one level to the context NOVELL_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 See

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)

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

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>. This command does not apply to OS/2 workstations.

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


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 See

Using the DOS BREAK command

Your DOS manual

Using the BREAK login script command

BREAK


DOS SET

See SET


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.

IMPORTANT:  On OS/2 workstations, DRIVE is effective only during execution of the login script. When the login script completes, you're returned to the drive in effect when the LOGIN command was issued.


Command Format

DRIVE [drive:|*n:]

Replace drive with a local or network drive letter, or replace n with a drive number. Use of either is dependant on their already 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've 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.

IMPORTANT:  This command does not apply to OS/2 workstations.


Command Format

EXIT [filename [parameters]]


Using EXIT

The length of information between quotes can't 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.

If you add EXIT to a container login script, it prevents other profile or user login scripts from running. If you put EXIT in a profile login script, it 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


Examples


Additional Information

For more information about See

Changing the machine name in NET.CFG

NetWare Client for DOS and Windows User Guide

Creating a menu

Creating a Menu File in 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


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 will 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

FIRE PHASERS signals 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 by itself 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.


Example

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


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

IMPORTANT:  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 below.


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

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


Using IF...THEN

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


Additional Information

For more information about See

Using identifier variables

Identifier Variables

Using the WRITE login script command to display messages

WRITE


INCLUDE

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

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


Command Format

INCLUDE [path]filename

or

INCLUDE object_name

To use a text file as a sub-script, 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 sub-scripts. Use these sub-scripts to supplement the main login script.

You can create and edit text file sub-scripts using any text editor. Sub-scripts do not have to have any particular filenames or extensions.

The INCLUDE command executes the login script commands contained in the sub-script. It does not display the text of the sub-scripts.

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

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

If you are using another object's login script as a sub-script, 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


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.

The MACHINE command does not apply to OS/2 workstations.

IMPORTANT:  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 See

Setting machine names in the NET.CFG file

NetWare Client for DOS and Windows User Guide

Using identifier variables

Identifier Variables


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 either 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 a Novell Directory Services (NDSTM) 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:


Using MAP


Mapping Search Drives

NOTE:  OS/2 workstations do not use search drives. Instead, OS/2 users use the OS/2 commands PATH, DPATH, and LIBPATH in their CONFIG.SYS files.

For DOS and MS 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 they are currently working in.

A maximum of 16 NetWare search drives are 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 break 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:

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 map objects in the user's current context. Don't 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.NOVELL_US, add the following line to the login script:

MAP S2:=.APPL.SALES_LA.NOVELL_US

In the above 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.NOVELL_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


Examples


Additional Information

For more information about See

Drive mappings

Drive mapping in Concepts

Enabling users to run DOS from the network

Loading DOS onto the Network

Setting paths for OS/2 workstations

IntranetWare Client for OS/2 User Guide

Using Directory Map objects

Loading Operating Systems and Applications onto the Network


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 See

Using the # command

# (Execute External Program)

Using the SWAP command

SWAP


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.

This command does not apply to OS/2 workstations.


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 See

Setting the machine name in NET.CFG

NetWare Client for DOS and Windows User Guide

Using the EXIT command

EXIT


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

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

NetWare 2 and 3 users can use SCRIPT_SERVER to set a home server from where the bindery login script is read.

NOTE:  SCRIPT_SERVER has no effect on NetWare 4 users.


Command Format

SCRIPT_SERVER server_name


Using SCRIPT_SERVER

This command has no effect on Novell Directory Services.


SET

Use SET to set a DOS or OS/2 environment variable to a specified value.

For OS/2 workstations, SET commands affect the environment only while the login script is running; the settings disappear when LOGIN terminates.


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 itself after the login script has finished executing, use the optional keyword TEMP.

NOTE:  Variables set in the login script for an OS/2 workstation affect the environment only while the login script is running. Therefore, the TEMP option does not work with OS/2 workstations.


Using SET

Use the SET login script command the same way you use the DOS command called 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 quote preceded by an escape character. To avoid this problem, use two backslashes before the ending double quotes (\\).

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.

For information about values you can set, see the SET command in your DOS or OS/2 documentation.

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. (OS/2 workstations do not have this limitation.)

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


Additional Information

For more information about See

Using environment variables as identifier variables in other login script commands

Identifier Variables

Using the SET command

Your DOS or OS/2 manual


SET_TIME

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


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. SHIFT 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 See

Using %n variables in login scripts

Table 19


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 doesn't 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 don't 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 doesn't 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 See

Using the # command

# (Execute External Program)

Using the NOSWAP command

NOSWAP


TEMP SET

See SET


TREE

NOTE:  The TREE command can only be used with clients that support multiple Novell Directory tree attachments.

Use TREE to attach to another Novell Directory tree within your network and to access its resources.

The TREE command changes the focus of your login script, so that all NDS object references in subsequent script commands---for drive mappings, print captures, etc.---apply to the Novell Directory tree specified in the TREE command.

You can include multiple TREE commands within a login script, either to attach to additional Novell Directory trees or to switch the login script's focus back to a tree that you're already attached to.


Command Format

TREE tree_name[/complete_name[;password]]


Using TREE

Replace tree_name with the name of the Novell Directory tree that you want to attach to.

Replace complete_name with your complete name (Distinguished Name) for the Novell Directory tree that you are attaching to. The complete name establishes your context in the tree. If you do not include the complete name, the user is prompted for a complete name when the TREE command is executed from the login script.

You can replace password with the correct password for that user and tree. 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 TREE command is executed, the user is prompted for the password.


Example

To attach the user with the complete name MRICHARD.ACME (whose password is GOLFING) to a Novell Directory tree named CORP, add the following line to her login script:

TREE CORP/.MRICHARD.ACME;GOLFING


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 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:

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 commands, the displays all appear as one continuous sentence or paragraph (although they may wrap onto additional lines on the workstation's screen).

Text strings can include the following special characters:


Table 17.

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 additional 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 the following table, in order of precedence.


Table 18.

Operator Meaning

* / %

Multiply, divide, modulos

+ -

Add, subtract

>> <<

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


Examples