External Commands

This section describes commands provided by ICMD.NLM, a companion to the NetWare Installation NLMs (INSTALL.NLM and NWCONFIG.NLM). See NetWare Installation Command Version Availability for a table showing the ICMD versions that support these commands.


Version 2.10 External Command Compatibility

If you intend to use ICMD.NLM 2.18 or greater, do not copy this new version to SYS:SYSTEM. Instead, copy it to a different directory and load it from there.

For example, the script commands below will copy ICMD.NLM to a temporary directory and load from there.

CopyToServer SYSTEM\TMP, ICMD.NLM, "", ""
Command TMP\ICMD

Using this method ensures that the ICMD.NLM version in SYS:SYSTEM is the actual 4.10 version and that all built-in products that use it will work properly. The new ICMD.NLM might still be fully backward-compatible, but it has not yet been fully tested in that regard.


External Command Syntax

To use any of the external commands made available by the ICMD.NLM command handler, include the statement command [<filepath>] ICMD in the script file. Use CopyToServer to copy ICMD.NLM to a temporary directory (for example, SYS:SYSTEM\TEMP), then use command to run it from there (for example, command SYS:SYSTEM\TEMP\ICMD). This removes any compatibility problems associated with using the standard ICMD.NLM in SYS:SYSTEM. You can create then add additional commands to your own version of ICMD.NLM (after you rename the file) to perform application-specific functions.


Commands


Activate


Syntax
Activate

Description

Activate causes the installation screen to be activated.


Example

Activate

The installation screen will be displayed for further script processing.


AppendFile


Syntax
AppendFile <src var name>, <src file spec>, <src vol name>, <src descr>, <dest var name>, <dest dir>, <dest vol name>, <dest descr>

Description

AppendFile appends the contents of the source file onto the destination file. It creates a temporary file that is as large as the destination file, then renames that file to the destination file. Wildcard characters for <src file spec> are not allowed.


Example

AppendFile input, file1, 'NETWARE-1', "NW [1]", output, file2, '', ''

The user is prompted for diskette NW [1], which is verified by checking for volume label NETWARE-1. The FILE1 on that diskette is appended to FILE2 in the directory corresponding to output.


AppendTextToFile


Syntax
AppendTextToFile <src var name>, <src file spec>, <src vol name>, <src descr, <text>

Description

AppendTextToFile appends the contents of the literal text onto the destination file. It also places a date timestamp with every entry. Wildcard characters for <src file spec> are not allowed.

If the file is found, the value of variable NWSTATUS will be zero; otherwise it will be non-zero.


Example

AppendTextToFile input, file1, 'NETWARE-1', "NW[1]", 'Installation Complete'

The user is prompted for disk NW[1], which is verified by checking for volume label NETWARE-1. The FILE1 on that disk will be appended to FILE2 in the directory corresponding to the output.


CheckFile


Syntax
CheckFile <var name>, <file spec>, <vol name>, <description>

Description

CheckFile checks for the existence of <file spec> at a path determined by the value of <var name>. If the path is a floppy, and <vol name> is non-null (not ''), the user will be prompted for disk <description> if it is not already in the drive.

If the file is found, the value of variable NWSTATUS will be zero; otherwise it will be non-zero.


Example

CheckFile NWSRC, file1.dat, '', ''
GotoIfNEqual '%{NWSTATUS}', 0, FileNotFound
File found
.
.
Label FileNotFound

In this example, a check is made for a file (FILE1.DAT). If the file is found at the path determined by NWSRC, execution continues on the next line. If the file is not found, control branches to label FileNotFound.


Config


Syntax
Config <flag>

Description

Config creates a configuration file with available default information from the installation. If <flag> is 1, AUTOEXEC.NCF is created on SYS:SYSTEM; if 0, STARTUP.NCF is created in the server boot path.


Example

Config 1

This command creates AUTOEXEC.NCF, with server name, internal net address, configured LAN driver load and bind commands, directory service and time services information. The existing AUTOEXEC.NCF on SYS:SYSTEM is overwritten.


Console


Syntax
Console <text>, <delay in seconds>

Description

Console enters the text on the system console screen and delays <delay in seconds> before returning control back to the calling process. Because the system installation process executes in a different thread from the console, it is possible that the next command might finish before this Console command does. If the delay is set at -1, Console will delay until the system console screen has processed all the commands in its buffer.


Example

Console 'load ne2000 frame=ethernet_802.3 int=3 port=300', 10

Console 'bind ipx to ne2000 net=1240000', 3

These commands load and bind an NE2000TM driver to IPXTM.


CopyFile


Syntax
CopyFile <recurse flag>, <directory flag>, <empty flag>, <attribute flag>, <attributes>, <src var name>, <src file spec>, <src vol name>, <src descr>, <dest var name>, <dest dir>, <dest vol name>, <dest descr>, [<conditional copy flag>]

Description

CopyFile copies files (wildcards are allowed in <src file spec>) from the source path to the destination path.

<recurse flag> (0|1)

Value Description

0

Do not copy subdirectories recursively.

1

Copy subdirectories recursively.

<directory flag> (0|1|2|3)

Value Description

0

Source is a file.

1

Source (including <src file spec>) is a directory; copy directory contents to destination.

2

Source and the destination are files (file-to-file copy). <recurse flag> must be 0 if <directory flag> is 2

3

Source (including <src file spec>) is a directory; copy directory contents to destination only if that directory already exists on the destination.

<empty flag> (0|1)

Value Description

0

No error if no files are found.

1

Error if no files are found.

<attribute flag> (0|1|2)

Value Description

0

Use the default file set attributes.

1

Use the source file's attributes.

2

Use the attribute specified by <attributes> (must be used to copy to DOS drive).

<attributes>

For a DOS file:

Attribute Meaning

00000001

Read Only

00000002

Hidden

00000004

System

00000008

Volume Label

For a NetWare file:

Attribute Meaning

00000001

Read Only

00000002

Hidden

00000004

System

00000008

Execute

00000010

Subdirectory

00000020

Archive

00000080

Shareable

00000700

Smode

00001000

Transaction

00004000

Read Audit

00008000

Write Audit

00010000

Immediate Purge

00020000

Rename Inhibit

00040000

Delete Inhibit

00080000

Copy Inhibit

Reserved path names (<src|dest var name>) are NWSRC, NWDST and NWBOOT, the standard source, destination and boot path for NetWare files. <dest dir name> can be a null string.

<conditional copy flag>

Value Description

0 (or not present)

Unconditionally copy this file.

1

Copy if destination file is not present.

2

Copy if destination file is not present; if it is, prompt user (no version check).

3

Copy if destination file is not present or if the source file version is newer than the destination file version.

4

Copy if destination file is not present or if the source file version is newer than the destination file version; otherwise, prompt the user.

5

Copy if destination file is present (no version check).

6

Copy if destination file is present and source file version is newer than destination file version.

7

Copy if destination file is present and source file version is newer than destination file version; otherwise, prompt the user.

8

Copy if destination file is not present or if source file version is newer than destination file version (refresh with new files).

9

Copy only if destination file is present and source file version is newer than destination file version (refresh existing files).


Example

CopyFile 0, 0, 1, 0, 0, input, *.*, 'NETWARE-1', "NW [1]", output, '', '', ''

This is a continuation of the examples for GetPath . The user is prompted for diskette NW [1], and the diskette is verified by checking for volume label NETWARE-1. All files on the diskette are copied to the subdirectory the user indicated for output.


CopyFloppyImage


Syntax
CopyFloppyImage <floppy type flag>, <diskette name>, <src var name>, <src file spec>, <src vol name>, <src descr>, <dest var name>, <dest dir>, <dest vol name>, <dest descr>

Description

CopyFloppyImage copies a diskette image file sector by sector to the specified drive (destination path which must be a diskette drive).

Variable Description

<floppy type flag> (0|1)

0 indicates a 3.5-inch high-density drive. 1 indicates a 5.25-inch high-density drive.

<diskette name>

The external label for the diskette.


Example

GetPath, dst, 2, 'A:', ''

CopyFloppyImage 0, "Disk 1", 3.5\WSDOS_1.IMG, '', '', dst, '', '', ''

The floppy image specified by the source path is copied to the diskette in the specified drive.


Delay


Syntax
Delay <delay in seconds>

Description

Delay relinquishes control for <delay in seconds> seconds before returning control back to the calling process. If a negative value is used, the delay is a random value from 0 to the absolute value of <delay in seconds>.


Example

Delay '-10'

This delays randomly from 0 to 10 seconds.


DiskReset


Syntax

DiskReset <var name>


Description

DiskReset tells DOS to rescan the directories on the <var name> floppy drive. This is necessary because the drive change interrupt is disabled while NetWare has control.


Example

Assuming myDir corresponds with A:\

DiskReset myDir

Drive A:\will be rescanned.


Dismounted CD


Syntax

DisMountCD <CD Volume Name>


Description

DisMountCD is to be used with PromptForCD (below). It is used to dismount a CD volume that has been mounted via the PromptForCD command.


Example

DisMountCD 'CDVolumeName'


Display_Text_File


Syntax
Display_Text_File <Path>, <Filename>, <Completion Code>

Description

Display_Text_File displays an ASCII text file. The user can scroll the text in any direction to read the entire contents of the file. Scroll bars automatically display if needed. The maximum file size is 30 KB for the file.


Example

GetPath sys, 1, 'SYS:', ''

Display_Text_File sys, "license.txt", ccode

The completion code will return a 0 (zero) for a successful return. Anything else is an error.


Display


Syntax
Display <0|1|2>, "...<text>..."

Description

Display displays a message, accompanied by a beep if the first argument is 1. If the argument is 2, the message is displayed as a copy status.


Example

Display 0, "Product XYZ installation is complete."

The text is displayed (without a beep), and the user can press Enter to continue.


DSInst


Syntax

DSInst <time zone name>, <time server type>, <daylight flag>, <daylight start>, <daylight end>, <daylight offset in seconds>, <tree name>, <tree address>, <container object name>, <admin name>, <admin password>, <replica flag>, <upgrade bindery flag>, <root server flag>


Description

DSInst installs the directory with default time synchronization.

Variable Description

<time zone name>

Time zone name (works as a system SET parameter)

<time server type>

Time server type (works as a system SET parameter): single, reference, primary, secondary

<daylight flag>

1: Daylight savings time exists in this time zone0: Daylight savings time doesn't exist in this time zone

<daylight start>

"set parameter" daylight savings time start string. For Example First Sunday of April at 2:00:00 a.m

<daylight end>

"set parameter" daylight savings time end string. For Example Last Sunday of October at 2:00:00 a.m.

<daylight offset in seconds>

Typically this is 3600 (seconds per hour), or zero if daylight saving time is not applicable.

<tree name>

DS tree name

<tree address>

Internal IPX address of the SAP server for the tree

<container object name>

Full DN of container

<admin name>

Full DN of Admin object (must have supervisor rights on the container)

<admin password>

Password for <admin name>

<replica flag>

1: Install a replica on this server; 0: don't install

<upgrade bindery flag>

1: Upgrade the bindery if it exists; 0: don't install

<root server flag>

1: Make this a new tree; 0: don't make this a new tree


Example

DSInstMST7MDT, SECONDARY, 1, '(APRIL SUNDAY FIRST 2:00:00 AM)', '(OCTOBER SUNDAY LAST 2:00:00 AM)', 3600, URSA, FACE3234, 'O=Novell', 'CN=Admin.O=Novell', '', 1, 1, 0

Time services will be installed with this server as a secondary server using existing tree name URSA. Directory services will be installed, with this server in container O=Novell. This server will have a replica installed, and its bindery will be upgraded.


EraseFile


Syntax
EraseFile <directory flag>, <var name>, <file spec>, <vol name>, <vol descr>

Description

EraseFile recursively erases the file or directories indicated in <file spec>. Wildcards are acceptable. In NetWare, files can be removed no matter what their attributes; in DOS, only normal files can be removed.

IMPORTANT:  Use this command with care to delete only the intended data.

If <directory flag> is 1, <file spec> must be a directory name; the contents of the directory will be deleted, but the directory will not.


Example

If myDir corresponds to VOL1:\.

EraseFile 1, myDir, '', '', ''

The contents of directory VOL1:\ will be erased.


EditNCF


Syntax
EditNCF <ncf path var>, <ncf file name>, <backup ext>, <ccode>

Description

EditNCF edits the specified NCF file as follows:


Example

GetPath startup, 1, 'C:\\NWSERVER', ''

EditNCF_KEYSTRING ''

EditNCF_KEYSTRING 'PK411.NLM'

EditNCF startup, 'startup.ncf', 'bak', ccode

The contents of C:\NWSERVER\STARTUP.NCF will be searched for a line containing PK411.NLM and will be commented out by the EditNCF command. Ccode will contain the following:

0 - Success
1 - Duplicate Extension
2 - Open Error
3 - Read Error
4 - Write Error
5 - NCF to Backup Extension Error
6 - Tmp to NCF Error


EditNCF_ADDLINE


Syntax
EditNCF_ADDLINE <LineToBeAdded>

Description

EditNCF_ADDLINE adds a line of text to the list of lines to be added at the top of the file being edited with EditNCF.


Example

EditNCF_ADDLINE ''

EditNCF_ADDLINE 'LOAD PK411.NLM'

EditNCF startup, 'startup.ncf', 'bak', ccode

The first line will clear the ADDLINE list. The second line will add the string "LOAD PK411.NLM" to the top of the STARTUP.NCF file.


EditNCF_KEYSTRINGS


Syntax
EditNCF_KEYSTRINGS <keystring>

Description

EditNCF_KEYSTRINGS defines a list of keystrings to be used by EditNCF when determining which lines to comment out. (A line will be commented out if it contains any of the keystrings).

NOTE:  The list must be terminated with a null string (empty quotes) for the last entry. This command can be used multiple times. Each time replaces the previously defined list.


Example

EditNCF_KEYSTRINGS ''

EditNCF_KEYSTRINGS 'PK411.NLM', 'ADTRSTFX', 'AUTODUMP', 'CLSSCRFX', 'EAPURGFX', 'EVNTRPFX', 'GETDIRFX', ''

EditNCF startup, 'startup.ncf', 'bak', ccode

The first line clears the KEYSTRING list. The second line adds the strings to the list to be commented out of the STARTUP.NCF file.


ExtractVersionNumbers


Syntax
ExtractVersionNumbers <version string>, <major var name>, <minor var name>, <revision var name>

Description

ExtractVersionNumbers parses a version string and returns the major version number, minor version number, and revision number as integers. Version string is parsed and leading non-digits are ignored. The variables are filled with the major, minor, and revision values for the version string. If no revision value is in the version string, a zero is returned. If the revision value is a non-digit value, a numeric revision value is returned (i.e., A = 1, B = 2, etc.).


Example

SetVar version, "v2.11"

ExtractVersionNumbers version, major, minor, revision

The variable version contain the string "v2.11". ExtractVersionNumbers returns a value of 2 in the variable major, a value of 11 in the variable minor. And a value of 0 in the variable revision.


FileVersion


Syntax
FileVersion <src var name>, <src file spec>, <src vol name>, <src descr>, <Module major number>, <Module minor number>, <Module rev number>, <Module description>, <return code>

Description

FileVersion returns the major, minor, and revision numbers as well as the description string of the NetWare Loadable Module (NLM, HAM, CDM, LAN, etc.) as long as the return code is 0.

IMPORTANT:  This works only for NetWare Loadable Modules ( that is, it does not work with .EXE or .DLL files, etc.).


Example

GetPath1, 1, 'SYS:\\SYSTEM'

File Version path1, 'DS.NLM', '','', DSMajor, DSMinor, DSRev, DSDesc, DSCode


GetDOSServer


Syntax
GetDOSServer <var name>

Description

GetDOSServer returns the default DOS server number in <var name> on SFT* III servers.


Example

GetDOSServer DOSServer

The value of the variable DOSServer will be either 0 or 1. If the value is anything else, the server is not running SFT III.


GetPath


Syntax
GetPath <var name>, <path type>, <default>, <prompt>, [<base var name>]

Description

GetPath prompts the user for a path using the prompt. The prompt string will be displayed, with "%s" (like C-language print formatting) being replaced by the <default> string.

The keystrokes to modify will be added to your prompt. Trailing backslashes are always removed before the path is displayed. <var name> is a variable name that can be used later in a CopyFile command. If <prompt> is a null string, the user is not prompted; the path variable is set. If <base var name> exists, it will be used as a basis for the new variable (the remote connection number will be maintained, etc.).

<path type>

Value Description

1

Allow any path.

2

Allow floppy only (including remote).

3

Allow DOS only (including remote).

4

Allow NetWare local path only.

5

Allow local floppy only.


Example

GetPath input, 1, 'A:', "Files will be copied from %s\\."

The user will see the following prompts:

Files will be copied from A:\
Press <F3> to specify a different path.
Press <F4> to specify a remote path.
Press <Enter> to continue.

Goto


Syntax
Goto <label_name>

Description

Goto causes execution to continue at the first occurrence of label <label_name>.

The scope of a label is always local to a file set. Therefore, a Goto statement cannot transfer execution to a file set different from the current one.


Example

Goto Done

Label Done

The statement Goto Done will cause execution to continue at the label Done.


GotoIfEqual


Syntax
GotoIfEqual <larg1>, <arg2>, <label_name>

Description

GotoIfEqual causes execution to continue at the first occurrence of Label <label_name> if <arg1> is equal in value to <arg2>. Both <arg1> and <arg2> must be integers.

The scope of a label is always local to a file set. Therefore, a Goto statement cannot transfer execution to a file set different than the current one.


Example

GotoIfEqual 0, 1, Error

Goto Done

Label Error

Since 0 is not equal to 1, execution will not continue at label Error.

NOTE:  GotoIfEqual performs an integer comparison, not a string comparison.


GotoIfNEqual
GotoIfGreater
GotoIfLess
GotoIfGrEqual
GotoIfLsEqual


Syntax
GotoIfNEqual <arg1>, <arg2>, <label_name> 
GotoIfGreater <arg1>, <arg2>, <label_name>
GotoIfLess <arg1>, <arg2>, <label_name>
GotoIFGrEqual <arg1>, <arg2>, <label_name>
GotoIfLsEqual <arg1>, <arg2>, <label_name>

Description

These are identical to GotoIfEqual , except that execution branches only if (respectively):

<arg1> not equal to <arg2>
<arg1> is greater than <arg2>
<arg1> is less than <arg2>
<arg1> is greater than or equal to <arg2>
<arg1> is less than or equal to <arg2>

The scope of a label is always local to a file set. Therefore, a Goto statement cannot transfer execution to a file set different from the current one.

NOTE:  GotoIf* performs an integer comparison, not a string comparison.


Is_NLM_Active


Syntax
Is_NLM_Active <NLM Name>, <Completion Code>

Description

Is_NLM_Active searches the loaded modules list and returns 1 if the NLM is loaded, or 0 if the NLM is not present in memory.


Example

Is_NLM_Active "Monitor.nlm", ccode


IsSubString


Syntax
IsSubString <string>, <substring>, <index>

Description

IsSubString returns the zero based <index> of <string> where <substring> starts, if <substring> is indeed contained within <string>, otherwise <index> is -1.


Example

IsSubString 'Little Miss Muffet sat on', 'Miss Muffet', index

In this example, <index> would return as 7.


Label


Syntax
Label <label_name>

Description

Label serves only as a target of a goto statement with <label_name>.

IMPORTANT:  The scope of a label is always local to a file set. Therefore, a Goto statement cannot transfer execution to a file set different from the current one.


Example

Goto Done

Label Done

The Goto Done statement will cause execution to continue at Label Done.


LangVar


Syntax
LangVar <default>, <lang var>, <src var dir name>, <src vol name>, <src descr>

Description

LangVar sets a variable to the number of a language. It starts with <src var dir name>, then it looks for a subdirectory whose name is a number that matches the current server language number. If the subdirectory is found, <lang var> is set to that number; otherwise, <lang var> is set to <default>.


Example

Assuming the current language is 6:

LangVar 4, lang, NWSRC, '', ''

This command looks in the source install directory for a subdirectory named 6. Finding it, it sets lang to 6.


Menu


Syntax
Menu <var name>, <Prompt>, <# of menu options>, <default menu option>, <first choice>, <first value>, <second option>, <second value> [<third option>, <third value>,] [<fourth option>, <fourth value>]

Description

Menu command will display a window with the <Prompt> showing in a header area. The <choices> will display in a scrolling area below the header. The <# of menu options> is 1 based. The <default menu option> is zero based. The entire command is terminated without a comma after the final value.


Example

Menu done, "Are you ready to continue?", 2, 0,

"Yes", 1,

"No", 0

The Menu command displays a box on the screen with the Prompt "Are you ready to continue?" Below it the choices are "Yes" and "No." The "Yes" option is highlighted as the default option. Upon selecting the option, the value will be placed in the variable. The values must be integers.


NLMExec
NLMExecIO


Syntax
NLMExec <block flag>, <command line>

Description

NLMExec executes the NLM specified by <command line>. If <block flag> is 1, NLMExec waits for the NLM to complete execution, then continues. NLMExec is the external command version of the Exec command. NLMExecIO is identical to NLMExec except it executes the command line on the default DOS server on a NetWare SFT III server. See SetDOSServer for more information.


Example

NLMExec 1, PINSTALL

This command executes PINSTALL.NLM and waits for it to finish.


Partitions


Syntax
Partitions <delete flag>

Description

Partitions creates NetWare partitions as needed on all available devices. If <delete flag> is 1, all existing non bootable partitions will be deleted. If <delete flag> is 0, they will be left intact. The minimum allowable partition size is 1 MB, according to default rules (see @DeletePartition ).


Example

For one existing device with a DOS (active) partition and a NetWare 286 partition:

Partitions 1

This deletes the 286 partition and creates a NetWare partition in the remaining space.


PromptForCD


Syntax
PromptForCD <CD Volume Name>, <seconds to mount>

Description
PromptForCD is to be used with DisMountCD (above). PromptForCD will prompt the user to insert the CD labeled <CD Volume Name> into the CD drive and then will attempt to mount the CD volume within the <seconds to mount> time frame.

Example

PromptForCD 'CD 1', 30


Quit


Syntax
Quit

Description

Quit will exit the script processing at this point. No further processing will take place.


Example

GotoIfEqual %{variable1}, %{true}, Continue_On

Quit

Label Continue_On


ReadProductRecord


Syntax
ReadProductRecord <productID>, <recordtype>, <recorddatavarname>, <ccode>

Description

ReadProductRecord reads the record in the products database matching the <productID> and <recordtype> specified and returns the corresponding data. This command is the counterpart to the ProductRecord command. See ProductRecord for more information on record types.


Example

ReadProductRecord MYPROD, 0, version, ccode

The command will search the products database and return the value for <version> for product 'MYPROD'.


Read_Var_File


Syntax
Read_Var_File <path>, <filename>, <completion code>

Description

Read_Var_File will read the contents of the filename and create variables for script processing. The file is an ASCII formatted file with the content as follows:

"Variable1=true"
"Variable2=false"
"Variable3=Servername"


Example

Read_Var_File "sys:system", "varfile.txt", ccode

NOTE:  Ccode will return the file open status. 0 is success, anything else is an error. If the variable to the left contains any spaces, leading or trailing, the spaces will become part of the variable name and must be included with the variable when referencing it.


SetDir


Syntax
SetDir <var name>, <relative dir>, <vol name>, <vol descr>, <attributes>, <0|1>, <rights>

Description

SetDir creates directories (if they do not already exist), according to the <var name> obtained from GetPath . The <relative dir> value can be null. <attributes> are the attributes to use when creating the directory; 0 indicates normal attributes. If the <0|1> argument is 1, the server container object (or everyone) is given <rights> rights to the directory.


Example

If myDir corresponds to VOL1:\

SetDir myDir, DOC, '', '', 10, 1, 0

The directory VOL1:\DOC will be created and all applicable users will have rights to it.


SetDOSServer


Syntax
SetDOSServer <engine number>, <ccode>

Description

SetDOSServer specifies the <engine number> to be made the default DOS server (valid numbers are 0 and 1). This will set the default server used by the OS APIs.

NOTE:  DiskReset and GetPath can be directed to a particular IOEngine by first setting the DOS server as needed. This allows you to essentially map a path variable to a particular IOEngine. From that point on, that path variable will be associated with that IOEngine regardless of what the default DOS server is set to. Therefore, any commands that use path variables will target the IOEngine associated with the path variable rather than the default.


Example

SetVar IOEngineNumber, 0

SetDOSServer IOEngineNumber, ccode

The server's default IOEngine 0 will now be the default DOS server. Ccode will have a 0 for its value on success and a -1 for a failure.


SetLConfigLang


Syntax
SetLConfigLang <value>

Description

SetLConfigLang looks for the LCONFIG.SYS file in the server boot directory. The default server language ID number is changed to <value>.


Example

SetLConfigLang 9

The default server language ID number in the LCONFIG.SYS file is changed to 9 (Japanese).


SetVar


Syntax
SetVar <variable name>, <variable value>, [<Prompt>]

Description

SetVar sets a variable with <variable name> to the <variable value> string value. If the value does not exist, one is created. The variable value cannot exceed 127 characters in length.


Example

SetVar message, "Hello World!"

This causes a variable to be created with name "message," and its value set to the string "Hello World!"

NOTE:  The Prompt option is only available in version 3.25+.


SGotoIfEqual
SGotoIfNEqual
SGotoIfGreater
SGotoIfLess
SGotoIfGrEqual
SGotoIfLsEqual

The SGotoIf commands have the same options as the GotoIf commands. The SGotoIf commands perform a string comparison instead of an integer comparison.


SpaceCheck


Syntax
SpaceCheck <path var name>, <value>

Description

SpaceCheck looks at <path var name>. If it matches a NetWare volume, SpaceCheck checks whether the volume is large enough for <value> bytes, and whether the volume has enough free space for <value> bytes. If the volume is not large enough, the installation aborts. If there is not enough free space, the user is alerted and allowed to continue.


Example

Assuming srcVar corresponds to VOL1:\FILES

SpaceCheck srcVar, 1000000

Volume VOL1: will be checked for one million bytes of free space.

NOTE:  ICMD.NLM versions 3.25 and older do not support SpaceCheck on DOS drives. Newer versions support this drive option.


SrchNCF


Syntax
SrchNCF <ncf path var>, <ncf file name>, <keystring>, <foundline var name>

Description

SrchNCF searches an .NCF file for line containing a substring matching <keystring> (non case-sensitive). If found, the line of text will be returned; otherwise <foundline var name> will be empty.

NOTE:  The same value as not found will be returned if an error is encountered (for example, invalid filename, read error, etc). It is assumed that this command will be used before calling EditNCF which returns a more detailed completion code that can be acted on as necessary.


Example

GetPath sys, 1, 'SYS:\\', ''

SrchNCF sys, 'SYSTEM\\AUTOEXEC.NCF', "Load Monitor", ccode

The SrchNCF command will search the SYS:\SYSTEM\AUTOEXEC.NCF file for the string 'Load Monitor' and return the line number in ccode if found.


ValueSet
ValueAdd


Syntax
ValueSet <var name>, <value> 
Value Add <var name>, <value>

Description

ValueSet sets, and ValueAdd adds to, the numeric contents of variable <var name>.


Example

ValueSet srcVar, 1

The variable srcVar is created if it did not exist and is set to 1.


Volumes


Syntax
Volumes <minimum vol SYS: size in sectors>

Description

Volumes creates and mounts volumes on this server, with the volume SYS: placed on the first device larger than <minimum volume SYS: size in sectors> (512 bytes per sector). Additional volumes, named "VOL1", "VOL2", etc., will be created on other devices, one per device.


Example

For one existing device with 50 MB and a NetWare partition, but no volumes:

Volumes 51200; 25 MB minimum

This command creates volume SYS: on the device and mounts it. For more information on creating and mounting NetWare volumes, see the Volume Management API.


Write_Var_File


Syntax
Write_Var_File <path>, <filename>, <varname>, <var value>, <completion code>

Description

Write_Var_File will write the varname and var value to the filename specified by the path/filename. The file is an ASCII formatted file with contents as follows:

"Variable1=true"
"Variable2=false"
"Variable3=Servername"


Example

Write_Var_File "sys:system", "varfile.txt", "Variable1", "true", ccode

NOTE:  Ccode will return the file open status. 0 is success, anything else is an error. If the variable to the left contains any spaces, leading or trailing, they will be part of the variable name and must be included with the variable when referencing it later. If the filename doesn't exist, it will be created. The varname and var value will then be written. If the file does exist, the varname and var value will be appended to the contents of the file.



  Previous Page: Descriptors and Commands  Next Page: External Command Programming Interface