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. |
Use this command (the # symbol) to execute a program that is external to the login script.
# [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.
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
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
| For more information about | See |
|---|---|
Using the NOSWAP command |
|
Using the SWAP command |
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.
ATTACH [server[/username[;password]]]
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. 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
Use BREAK ON to allow the user to terminate execution of the login script. The default is BREAK OFF. BREAK ON|OFF
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. Use CLS to clear the display from the workstation's screen during the login process. 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. 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
COMSPEC=[path]COMMAND.COM
Replace path with either a drive letter or a full directory path beginning with the NetWare volume name. COMSPEC=%environment variable
For information about accessing the correct version of DOS from OS/2, see IntranetWare Client for OS/2 User Guide. Use CONTEXT to set a user's current context in the Directory tree. CONTEXT 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.
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.
Using ATTACH
Example
BREAK
Command Format
Using BREAK
CLS
Command Format
Using CLS
COMSPEC
Command Format
Using COMSPEC
Using COMSPEC with OS/2
CONTEXT
Command Format
Using CONTEXT
Example
Additional Information
| For more information about | See |
|---|---|
Context |
Context in Concepts |
Using the CX utility |
CX in Utilities Reference |
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.
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.
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.
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
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
DOS BREAK [ON|OFF]
Enter the following command in the login script: DOS BREAK ON
The default is DOS BREAK OFF.
DOS BREAK
Command Format
Using DOS BREAK
Additional Information
| For more information about | See |
|---|---|
Using the DOS BREAK command |
Your DOS manual |
Using the BREAK login script command |
See SET
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.
DOS VERIFY [ON|OFF]
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. 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.
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. 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. 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:
Use EXIT to terminate execution of the login script and execute an external program. IMPORTANT: This command does not apply to OS/2 workstations.
EXIT [filename [parameters]]
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 EXIT NMENU TRAINING
PCCOMPATIBLE EXIT NMENU TRAINING
IF DAY_OF_WEEK=MONDAY THEN EXIT WPUsing DOS VERIFY
DRIVE
Command Format
Using DRIVE
Example
EXIT
Command Format
Using EXIT
Examples
| 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 |
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
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.
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.
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 signals the workstation to emit a phaser sound. FIRE n
Replace n with the number of times you want this sound to occur. 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. 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 Use GOTO to execute a portion of the login script out of the regular sequence. GOTO label
Use label to indicate where the login script should continue executing. 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.
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. Use IF...THEN when you want the login script to perform an action only under certain conditions. 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. 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 equal sign (=) indicates the relationship between the variable (DAY_OF_WEEK) and its value (Monday). Note that the value (Monday) is inside quotation marks.
Six relationships are possible between the elements of an IF...THEN statement. Represent these relationships with the following symbols:
FIRE PHASERS
Command Format
Using FIRE PHASERS
Example
GOTO
Command Format
Using GOTO
Example
IF...THEN
Command Format
Using IF...THEN
| Symbol | Definition |
|---|---|
= |
Equals |
<> |
Does not equal |
> |
Is greater than |
>= |
Is greater than or equal to |
< |
Is less than |
<= |
Is less than or equal to |
IF DAY_OF_WEEK=MONDAY THEN
WRITE Status report is due today
ELSE
WRITE Have a nice day!
END
IF HOUR24>=12 THEN
WRITE afternoon
END
IF NDAY_OF_WEEK=4 THEN
#CAPTURE Q=FAST_Q NB TI=10 NFF
END
IF DAY_OF_WEEK=MONDAY THEN
MAP *6:=VOL1:APPL\WP
IF MEMBER OF CLERKS THEN
WRITE Your report is due immediately!
END
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
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
| For more information about | See |
|---|---|
Using identifier variables |
|
Using the WRITE login script command to display messages |
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.
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.
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.
INCLUDE VOL1:ADMIN\USERS\SCRIPT.NEW
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:
INCLUDE .SALES_PV_ALIAS.SALES.NOVELL_US
Figure 6 illustrates how the INCLUDE command executes the SALES_PV login script as part of the SALES_LA login script.
Figure 6
Using INCLUDE in a Login Script
Use LASTLOGINTIME to display the last time the user logged in. LASTLOGINTIME
If you include this command in your login script, the time of the last login is displayed on the user's workstation screen. 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. MACHINE=nameLASTLOGINTIME
Command Format
Using LASTLOGINTIME
MACHINE
Command Format
| For more information about | See |
|---|---|
Setting machine names in the NET.CFG file |
NetWare Client for DOS and Windows User Guide |
Using identifier variables |
Use MAP to map drives and search drives to network directories.
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:
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.
This option is valid only at the command line.
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.
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 with a different number of local drives than their regular workstation.
This drive mapping is used by OS/2 workstations, as explained in IntranetWare Client for OS/2 User Guide.
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. 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 MAP S1:=SYS:PUBLIC
The second search drive should be mapped to the DOS directory if users run DOS from the network.
To use variables for the DOS directory path, enter the following command in the login script: MAP S2:=SYS:PUBLIC\%MACHINE\%OS\%OS_VERSION
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 DOS onto the Network
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.NOVELL_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.NOVELL_US. Then use the following line in your login script: MAP S16:=WPROC
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
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 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.NOVELL_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:APPLUsing MAP
Mapping Search Drives
Mapping Drives to Directory Map Objects
Examples
| For more information about | See |
|---|---|
Drive mappings |
Drive mapping in Concepts |
Enabling users to run DOS from the network |
|
Setting paths for OS/2 workstations |
IntranetWare Client for OS/2 User Guide |
Using Directory Map objects |
Use NO_DEFAULT in a container or profile login script if you do not want the default user login script to run.
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. 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. 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.
Using NO_DEFAULT
NOSWAP
Command Format
Using NOSWAP
Additional Information
| For more information about | See |
|---|---|
Using the # command |
|
Using the SWAP command |
Use PAUSE to create a pause in the execution of the login script.
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. 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. 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: PCCOMPATIBLEUsing PAUSE
PCCOMPATIBLE
Command Format
Using PCCOMPATIBLE
| For more information about | See |
|---|---|
Setting the machine name in NET.CFG |
NetWare Client for DOS and Windows User Guide |
Using the EXIT command |
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.
PROFILE profile_object_name
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
Use REMARK to insert explanatory text into your login script. This text does not display on the screen. REM[ARK] [text]
or * [text]
or ; [text]
Replace text with the comment you want to include in the login script. 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). 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.
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.
SCRIPT_SERVER server_name This command has no effect on Novell Directory Services. 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. [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.
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>. SET PROMPT=$P$G
$P lists the current directory path; $G displays a > (greater than) character. See your DOS or OS/2 manual for more information.
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>
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>Example
REMARK
Command Format
Using REMARK
Example
SCRIPT_SERVER
Command Format
Using SCRIPT_SERVER
SET
Command Format
Using SET
Examples
| For more information about | See |
|---|---|
Using environment variables as identifier variables in other login script commands |
|
Using the SET command |
Your DOS or OS/2 manual |
Use SET_TIME to set the workstation time equal to the time on the NetWare server that the workstation first connects to.
SET_TIME ON|OFF
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. 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. SHIFT [n]
Replace n with the number of places you want the variable to shift. The default is SHIFT 1. 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. 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:
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:
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.
Using SET TIME
SHIFT
Command Format
Using SHIFT
Example
Additional Information
| For more information about | See |
|---|---|
Using %n variables in login scripts |
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.
SWAP [path]
You can replace path with either a drive letter or a full directory path beginning with the NetWare volume name.
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.
| For more information about | See |
|---|---|
Using the # command |
|
Using the NOSWAP command |
See SET
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.
TREE tree_name[/complete_name[;password]]
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. 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
Use WRITE to display messages on the workstation screen when a user logs in. 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.) 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:
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 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:
Using TREE
Example
WRITE
Command Format
Using WRITE
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) |
WRITE Hello
Either of the following lines displays Hello, Smith when user Bob Smith logs in:
WRITE Hello, ;%LAST_NAME
WRITE Hello, %LAST_NAME
WRITE Good %GREETING_TIME \7