Solstice NFS Client 3.2 User's Guide for Microsoft Windows 95 and Windows NT

SET [value_source] varname=value_specifier

Sets the environment variable named varname with the value obtained from value_source according to value_specifier.

value_source can be ABS, INI, NIS, REG, or STR.

Value Source 

Meaning 

ABS

Specifies the default, in which value_specifier is used directly as the value. 

Example:

SET ABS TEMP=C:\temp

sets the global variable TEMP to C:\temp.

INI filename

section key

default_value

Uses a .INI file as the source of the value with which to set the variable. The value has four space-separated fields:

filename - The name of the .INI file from which to obtain the value.

 

section - The section in the .INI file from which to obtain the value.

 

key - The entry from which to obtain the value.

 

default_value - The value to use if a value cannot be obtained from the .INI file.

Example:

SET INI C:\windows\win.ini mysection mykey myvalue

NIS

nis_map_name key

default_value

Sets a variable with a value from an NIS map or NIS+ table. This command looks up values in either or both NIS and NIS+, depending on the configuration of the local machine. The name service lookup order is honored. If the system is not using NIS or NIS+, an error is returned.  

The value has three fields separated by spaces: 

nis_map_name - The name of the NIS map or NIS+ table from which to obtain the value. To facilitate backward compatibility, you should use NIS map names. If the client is using NIS+, the script interpreter automatically converts NIS to NIS+ syntax. Table names are converted according to the following rules:

  • The first period in the name is converted to an underscore:

    	auto.home => auto_home
  • The string org_dir is appended:

    	passwd => passwd.org_dir
      	auto.dot => auto_dat.org_dir

    key - The value of the key in the map from which to obtain the value.

    default_value - The value to use if a value cannot be obtained from the NIS map or NIS+ table.

    Example:

    SET  NIS HOMEDIR=auto.home 
    %SNUSER% %SN_SERVER%:/tmp  

    Looks up a value of %SNUSER% in the auto.home map, and assigns it to HOMEDIR.

    If NIS+ is enabled on the client, auto.home is converted to auto_home.org_dir.

    If the lookup fails, HOMEDIR is set to the default value,

    %SNSERVER%:/tmp. 

REG

varname=keypath

value default

Sets a variable with a value from the system Registry. The value has three space-separated fields: 

keypath - Full path to the key containing the value. You can abbreviate HKEY_LOCAL_MACHINE to HKLM and HKEY_CURRENT_USER to HKCU.

value - Name of the value.

default - Value used if the key or value is not found.

If keypath or value_name contain spaces, enclose them in quotes.

The command retrieves values of type REG_SZ, REG_DWORD, REG_MULTI, and REG_BINARY of up to 200 bytes. REG_DWORD values are returned as hexadecimal values.

Example:

SET REG variable="HKLM\SOFTWARE\application\key" value NOTSET

STR

variable=option

values

value_specifier is a substring_specification string record. This space-separated record therefore has 2 fields. The substring_specification has three possible values: #, *, and N, where N is an integer digit.

The first specification (#) specifies that the variable's value is the count of space-separated tokens in the string.

The second specification (*) specifies that the variable's value is the string less the first token. This is analogous to a SHIFT LEFT operation, with the first token being discarded.

The last specification (0-N) specifies that the variable's value is the Nth token in the string, thus serving as an INDEX operation.

Example:

Set FIVE to the fifth item in %LIST%, and set NUM to the number of items. Set RESTLIST to %LIST% less the first token.

SET STR FIVE=5 %LIST%  
SET STR NUM=# %LIST%  
SET STR RESTLIST=* %LIST%