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 here) or login scripts that belong to a different object you have rights to.

Text files that contain login script commands, as well as other objects' 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 need 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, etc. In DOS, however, the maximum number of subscript files that you can nest is 10.

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.

You should include the path file name. In Linux, this could be a UNC path, regular mapping, or an eDirectory object name (either a simple eDirectory object name such as .user.company or a fully distinguished name such as .cn=user.o=company).

Command Format

INCLUDE [path]filename


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.


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


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.

You've decided 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:

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

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


The following figure illustrates how the INCLUDE command executes the SALES_PV login script as part of the SALES_LA login script.

Figure 3-1 How an INCLUDE Command Executes