#INTRODUCTION NCPLUS (Netware Console Plus) is an NLM designed for NetWare 3.11 and above. NCPLUS adds 33 commands to the original NetWare Console command interpreter. Some commands emulate DOS commands like DIR, DEL, COPY, CD... Others emulate Netware DOS utilities like NDIR, FLAG, NCOPY,etc... But the major "PLUS" of NCPLUS resides in its background and event driven commands. You can execute any kind of command (NCPLUS or NetWare) in the background, at a specific time or date or period of time. You may also execute commands according to the result of tests done on events, values of network objects and actions. NCPLUS includes commands to create, delete and control background and event driven procedures. It can be seen as an automat, avoiding the use of a DOS machine to control and manage actions on the network. NCPLUS offers some of the features of the CRON utility found on most UNIX systems. Using NCPLUS, you can run complex commands on the fileserver where NCPLUS is loaded or on other NetWare fileservers on which NCPLUS is logged in. Commands may be stored in procedure (batch) files like NetWare NCF files. NCPLUS can be logged on up to 8 servers (this is an arbitrary limitation), allowing automatic file transfer between servers. Some commands accept output redirection (!> or !>>) to Netware files), allowing the creation of log/audit trace files. #INSTALLATION To install NCPLUS, you need to copy the following files to the SYS:SYSTEM directory of a NetWare 3.11 (or above) fileserver: NCPLUS.NLM NCPLUS.HLP CLIB.NLM (Alpha 4.0) NCPLUS.HLP is not required to run NCPLUS, however no help will be available if the file is not present. NCPLUS uses the CLIB (C Library) NLM included in NetWare 3.x. If CLIB.NLM is not loaded before loading NCPLUS, NCPLUS will load it automatically. When running NCPLUS on NetWare server (or router) with no mounted file system, the files related commands of NCPLUS will not work. The 2 NCPLUS environment variables CWD (Current Working Directory) and DFS (Default FileServer) will contain respectively "NO_FILE_SYSTEM" and "NO_SERVER". NCPLUS works much better with the latest CLIB.NLM (Alpha 4.0) found on Novdev (May 1992). There's still a strange small problem: When loaded for the first time, and after using a couple of NCPLUS commands, once you unload NCPLUS you'll get a message explaining NCPLUS did not release 96 ressources (Small Allocation). When re-loading and unloading NCPLUS for the second time, you will not get this message. TO LOAD NCPLUS: At the console prompt, type: :LOAD NCPLUS [p=SUPERVISOR PASSWORD] [c=COUNTRY CODE] [x] Where : SUPERVISOR PASSWORD = The object SUPERVISOR password. When NCPLUS is loaded, username 'SUPERVISOR' is automatically loaded and you can not modify these connection for the default server where the NLM is loaded. COUNTRY CODE = The country code of the language you want NCPLUS use. NCPLUS is a multi language nlm. The language used by NCPLUS is initialized by the country code entered in this parameter. If no country code is specified then NCPLUS loaded then NCPLUS will use by default country code '1' US. X PARAMETER LOAD NCPLUS with X parameter should be used if you really want to use 100% CLIB compliant NLMs on your server. However, event driven or background procedures can quickly overload the corresponding working thread which will spend a lot of time trying to "ungetch" characters. As a simple rule, if your NCPLUS procedures react or run more than once per second, use LOAD NCPLUS without X parameter. If you have only 3 or 4 pending NCPLUS procedures, you can use X parameter. When specifying LOAD NCPLUS, the NCPLUS procedures/commands generating native console commands (like SET, LOAD, BIND, etc...) use a special C function directly calling the NetWare kernel. Background NCPLUS commands generating native console commands do not interfere with current keyboard input on the System Console Screen. When specifying X parameter, the NCPLUS procedures/commands generating native console commands (like SET, LOAD, BIND, etc...) push back characters into the console input stream (ungetch). If a NCPLUS background command needs to call a console command WHILE you are using the keyboard (System Console screen), your command will be mixed with the command generated by NCPLUS. This could cause problems like NCPLUS syntax errors or native console command parser famous "??? Unknown Command ???". If you're working on another NLM screen, your keyboard input will not be affected. You can include the LOAD NCPLUS command in you AUTOEXEC.NCF file. While NCPLUS is loaded (and eventually CLIB), no other activity will take place on the server. If the whole set of related NLMs needs to be loaded STREAMS.NLM CLIB.NLM NCPLUS.NLM this can take 15 to 20 seconds on a 386 20Mhz server. All NCPLUS commands run on the System Console Screen. It means that all NCPLUS messages are displayed on the System Console Screen, which is the only screen managed by NCPLUS. There are 2 consequences to this: - No interactive input is allowed on the console screen. This is why NCPLUS commands generating more than 25 lines of output cannot be stopped or paused. - NCPLUS Background or event driven procedures cannot call NetWare console commands requesting user input (SET , DISPLAY etc...). The only way to do it is to use X parameter. The NCPLUS HELP is the only command that creates a popup screen to handle output pauses. #COMMANDS NCPLUS commands can be grouped in 8 categories: - NetWare file system commands: NDIR, FLAG, NNCOPY, NTYPE, DEL, CD, MD, RD, REN - DOS file commands: DDIR, DNCOPY, NDCOPY, NTYPE - NetWare utilities: LOGIN, LOGOUT, WHOAMI, USERLIST, SLIST, CONNECTIONS, USEND - Environment control and test commands: PSET, IF, IFNOT - Event driven and background commands: ON, AT, EVERY - Status commands: PS, KILL - Output commands: ECHO, HELP - Miscellaneous commands: NOP, WAIT, EXEC Type HELP to get more info on each command. NCPLUS has its own environment variables (Type HELP VARIABLES, or HELP PSET). NCPLUS command line parser handles variable substitution and "aliases". An ALIAS is ANY command (NCPLUS or NW) preceeded by a colon (.). When you enter a command on the system console screen, NetWare first checks if this command is a NetWare native command. If not, the Netware console parser passes the command to the others registred command line parser NLMs. NCPLUS is one of them. NCPLUS then does the same thing: if the command is found, it executes it. If not found and if the command begins with a colon, NCPLUS will substitute any NCPLUS variables found in the command, remove the colon and pass the command back to the NetWare parser. This feature allows a native NetWare command to use NCPLUS environment variables. Ex: .BIND IPX TO %BOARD NET=%LAN .SET ALLOW UNENCRYPTED PASSWORD=%VALUE You can do things more simply, for the second example: PSET PWDON="SET ALLOW UNENCRYPTED PASSWORD=ON" PSET PWDOFF="SET ALLOW UNENCRYPTED PASSWORD=OFF" Then you can type %PWDOFF or %PWDON Remember that all NCPLUS commands can be included in NCF (NetWare Command File), so you can prepare a lot of aliases. IMPORTANT: The maximum command size for NetWare is 80 characters, equivalent to a single input line. If you need to create complex commands requesting a longer size, use NCF files to group commands. #AT AT: Run any command at a specified time. Syntax: AT hh:mm command_to_run [command arguments] AT starts a background procedure that will be executed at hh:mm:00. The command to be executed can be any command (NetWare or NCPLUS), EXCEPT commands that require keyboard input like SET, MODULES, DISPLAY, (when output scrolls up more than 24 lines),and commands like KILL and HELP. If you REALLY want to run those commands within an AT background process, you will need to load NCPLUS with the -X argument (LOAD NCPLUS -X). NCPLUS -X uses ungetch() to pass commands to the console command parser. The standard NCPLUS uses another (faster) way to pass commands to the main parser. Other solution: If you want to use SET in an AT command (ex: AT 23:59 set maximum transactions = 100), you can create a .NCF file containing the SET command (ex: TTS.NCF) and use AT 23:59 TTS. Exs: AT 12:00 SEND "It's Lunch time" AT 18:30 IF EXIST NLM NE1000.LAN UNLOAD NE1000 AT 23:59 UNBIND IPX NE1000 AT 02:00 BIND IPX NE1000 NET=33000001 (*) AT %GIVEN_TIME EXEC MYPROC AT 10:05 ECHO %CWD (1) AT 04:30 ECHO "%CWD" (2) AT 23:59 ".LOAD %X" (3) (*) Don't forget the NET=!!! Server will abend if BIND parameter is omitted. (1)The variable will be replaced by its value when AT is initialized (10:05). (2)The variable will be replaced by its value at 04:30. (3)See DOT topic Remarks: AT commands run only once and are removed from the background queue upon completion. See Also: EVERY, ON, PS, KILL #CD CD: Change or Display the Current Working Directory. Syntax: CD [New_Netware_Directory] If no directory is specified, the current directory is displayed. CD accepts all path symbols (/ \ . ..) and fileserver names. If NCPLUS is also logged on remote servers, the CD command can be used to change the current fileserver to a remote fileserver. Exs: CD CD .. CD REMOTE_SERVER/SYS:PUBLIC CD %MYDIR Remarks: 1) The current working directory (cwd) can be found in the NCPLUS environment variable CWD. %CWD contains the NCPLUS current fileserver/directory. This value is updated every time a NCPLUS command (or dot command) is called. If no volumes are mounted (i.e. external 3.11 router),CD will display a warning message .%CWD then contains "NO_FILE_SYSTEM" and %DFS equals "NO_SERVER". 2) CWD will be changed to FILESERVER/SYS: every time you use the LOGIN FILESERVER/USERNAME command. See Also: Environment VARIABLES, LOGIN, RD, MD #CONNECTIONS CONNECTIONS: Set the reserved environment variable CONNECTIONS to the number of currently logged users. Syntax: CONNECTIONS CONNECTIONS is designed primarly to run within an EVERY command, to set regularly the variable CONNECTIONS. Ex: EVERY 60 CONNECTIONS EVERY 60 IF "%CONNECTIONS">240 USEND SUPERVISOR "SERVER CROWDED!!!" EVERY 60 IF "%CONNECTIONS"=1 SEND "YOU'RE THE LAST ONE: GO HOME" Do not forget to put %CONNECTIONS between quotes. See Also: Environment variables, IF, IFNOT, EVERY #DDIR DDIR: Display the contents of a DOS directory. Syntax: DDIR [Local_DOS_Pathname] DOS must be present. Wildcard characters are allowed. DDIR will display the directory contents with name+ext, size, creation date, creation time and current DOS attributes (Ro/Rw Sy, Hi, A, etc...). DDIR supports redirection to a NetWare file. Exs: DDIR (with no args = DDIR current_dos_dir\*.*) DDIR C:\*.SYS !> REMOTE/SYS:STAT/FILE DDIR C:\*.* !>> REMOTE/SYS:STAT/FILE IF EXIST DFILE C:\DOS DDIR C:\DOS\*.* ELSE ECHO "NO DOS SUBDIR FOUND" See Also: DTYPE, NDIR #DNCOPY DNCOPY: Copies a local DOS file to a local or remote NetWare directory. Syntax: DNCOPY Source_DOS_Pathname Destination_NetWare_Pathname DOS must be present. The current version of NCPLUS does not support wildcard characters in source filenames. NCPLUS must have sufficient rights to write destination file on a remote (or local when logged in) server. Exs: DNCOPY C:\DOS\BASICA.EXE REMOTE_SERVER/SYS:PUBLIC/DOS/BASICA.EXE AT 23:50 DNCOPY C:\AUTOEXEC.BAT %CWD/LOCAL.BAT (1) AT 23:50 DNCOPY C:\AUTOEXEC.BAT "%CWD/LOCAL.BAT" (2) DNCOPY C:\CONFIG.SYS CONFIG.SYS (1) Target directory is current CWD at the time command was entered. (2) Target directory is CWD at 23:50 See Also: NDCOPY, NNCOPY. #DTYPE DTYPE: Displays the content of a local DOS file on the console screen Syntax: DTYPE Local_DOS_Pathname DOS must be present. CTRL+S and CTRL+Q are not supported in this version. Exs: DTYPE C:\AUTOEXEC.BAT DTYPE D:\%MYFILE IF EXIST DFILE C:\README.DOC DTYPE C:\README.DOC ELSE ECHO "NO FILE FOUND" You should avoid reading files located on floppies: The disk drive motor will not stop.... In general, accessing DOS devices from NCPLUS is a long and blocking procedure. Use DOS related commands when there's little or no activity on the server, and when it is absolutely necessary. See Also: NTYPE, DDIR, DNCOPY, NDCOPY #DEL DEL: Deletes a local or remore NetWare file. Syntax: DEL Netware_Pathname Wildcard characters allowed. NCPLUS must have sufficient rights to delete files on a remote (or local when logged in) server. WARNING!! DEL *.* will not ask "Are you sure?" and will only delete files with an extension. DEL * will delete everything !! Remember Netware wildcard characters extension include the '.' as a valid character in '*' or '?' Exs: DEL REMOTE_SERVER/SYS:PUBLIC/*.MNU DEL *.NCF DEL %THISFILE See Also: RD #ECHO ECHO: Echoes a string or variable to console screen Syntax: ECHO [VARIABLE | STRING] Note: ECHO supports redirection to a NetWare file. Exs: ECHO Current directory is %CWD !> FILE (1) ECHO "Current directory is %CWD" !> FILE (2) ECHO (3) ECHO BONJOUR MONSIEUR (4) ECHO "BONJOUR MONSIEUR" (5) (1) FILE will contain something like "Current directory is SYS:DIRECTORY" (2) FILE will contain "Current directory is %CWD" (3) This prints a CR+LF on screen (4) This gives "BONJOUR MONSIEUR" (only 1 space between 2 words) (5) This gives "BONJOUR MONSIEUR" (space between quotes are protected). See Also: NOP #EVERY EVERY: Run any command at a specified time interval Syntax: EVERY [nb_of_secs | Day of week] command_to_run [command args...] EVERY starts a background procedure that will be executed every nb_of_secs, or every specified day of week: MONDAY,TUESDAY, THURSDAY.....SUNDAY The command to be executed can be any command (NetWare or NCPLUS),EXCEPT: - commands that require keyboard input. - SET, MODULES, DISPLAY, KILL and HELP See HELP AT for ways to use these commands with EVERY. Note: For the EVERY day_of_week form, the given command will be executed within the first minute of the specified day, i.e 00:01:00 Exs: EVERY 3600 .SEND "IT'S %TIME" EVERY 3600 ECHO "IT'S %TIME !> FILE" (1) EVERY 60 IF EXIST LOGGED_USER * SEND "GET OUT OF HERE!" ELSE BACKUP EVERY 50000 NNCOPY REMOTE1/SYS:DATA/*.DTA THIS_ONE/SYS:BACKUP EVERY MONDAY DEL *.BAK EVERY SUNDAY SEND "YOU SHOULD GO BACK HOME NOW" EVERY FRIDAY AT 18:00 EXEC BACKUP EVERY 60 IFNOT EXIST ACTIVE MYPSERVER, .SEND "%TIME:PRINT SERVER GONE!!" EVERY 60 IFNOT EXIST ACTIVE REMOTE_SERVER, .SEND "%TIME:REMOTE LINK DOWN!" (1) The redirection sign must be protected by quotes. See Also: AT, ON, PS, KILL, CONNECTIONS #EXEC EXEC: Runs a command file. Syntax: EXEC [[SERVER]VOLUME:]DIRECTORY/PROCEDURE_FILE EXEC will execute all the Console or NCPLUS commands included in the specified file. This file can be located in any NetWare directory (local or remote). It is useful when you want to execute more than one command with AT, EVERY OR and IF. It's just like a .NCF file but it can be anywhere, and variables are supported and expanded. Variables will be substituted by their values at the time EXEC is entered, or by their values at the time EXEC is executed if variable names are protected in quotes. The file must contain one command per line (max 80 chars!!!). Lines beginning with a '#' are not executed (comments). You must specify the name+extension of the procedure file you want to execute. Exs: EXEC REMOTE1/SYS:SYSTEM/AUTOEXEC.NCF (bad example!!) EXEC BSTART (1) IF EXIST NFILE SYS:USERS/COMMON/*.BAK EXEC CLEANUP ELSE ECHO NO .BAK FILES EVERY 60 EXEC SNAPSHOT ON NEWOBJ EXEC AUDIT ON CHGSEC EXEC WARNBOSS (1) This will start BTRIEVE like you can start it when issuing the command BSTART, but BSTART.NCF lines will be displayed as executed. See Also: AT, EVERY, ON, WAIT, DOT commands #FLAG FLAG: Changes NetWare files attributes like the NetWare FLAG utility. Syntax: FLAG Netware_file [FLAG LIST] where FLAG LIST is a list of flags separated by a space. Wildcard characters are allowed. Redirection to a Netware file is supported. Note: If NCPLUS is logged in, user restrictions apply. FLAG LIST: TO SET TO UNSET RO: Read Only RW: Read Write H: Hidden NH: Non Hidden X: Execute Only No return Ticket!!!! A: Archive NA: Non Archive S: Shareable NS: Non Shareable SY: System NSY: Non System T: Transactional NT: Non Transactional RA: Read Audit (No effect) WA: Write Audit (No effect) P: Purge Immediate NP: Non Purge Immediate R: Rename Inhibit NR: Non Rename Inhibit D: Delete Inhibit ND: Non Delete Inhibit C: Copy Inhibit NC: Non Copy Inhibit Exs: FLAG SYS:SYSTEM/*.NLM S RO D C FLAG SYS:PUBLIC/*.EXE NS RW !>> RESULT FLAG REMOTE/SYS:PUBLIC/*.* %MYFLAGS Warning!!! FLAG allows ANY file to be flagged EXECUTE ONLY. Don't do it on data files or on SYS:SYSTEM/*.* !!! Once flagged Execute Only there is NO WAY to set it back to non execute only. See Also: NDIR, DDIR. #HELP HELP: Prints help topics found in the NCPLUS help file Syntax: HELP [TOPIC | keyword | NCPLUS_Command] HELP with no parameters will display the list of NCPLUS commands. HELP TOPIC will display the list of help topics found in the help file. A topic is an help keyword found in the help file. The NCPLUS help file (NCL.HLP) must be located in the SYS:SYSTEM directory of the original fileserver. If volume SYS: is not mounted (i.e. on an external 3.x router), no help is available. You can add, modify or delete topics in the help file. NCL.HLP is a plain ASCII file where topics are delimited by a line beginning with the # symbol. "#EVERY EVERY: Execute a command at a specified frequence ...... ..... #DDIR" When you type HELP EVERY, everything between the line "#EVERY" and the next line beginning with # will be displayed on a pop-up screen. You can add help topics on anything you want. Help will pause between each screen if one help screen is longer than 24 lines. Exs: HELP HELP DOT HELP TOPIC HELP NCPLUS HELP HELP (this screen!) #IF IF .... ELSE .....: execute a command if a test result is TRUE IFNOT .... ELSE .....: execute a command if a test result is FALSE Syntax: IF command_run_if_true [ELSE command_run_if_false] IFNOT command_run_if_false [ELSE command_run_if_true] where CONDITION can be: EXIST [KEYWORD ARGS] or NCPLUS_VARIABLEVALUE A) EXIST KEYWORDS DFILE (wildcard ok). Any valid DOS filename. TRUE if at least one file exists. NFILE (wildcard and remote server path ok).TRUE if at least 1 file can be seen. NLM (no wildcard). Can be NLM,LIB,LAN,DSK,NAM,etc. TRUE if loaded (locally) LOGGED_USER (wildcard ok). TRUE when user logged in local server. SERVER (wildcard ok) TRUE if server active. local server NEVER seen. VOLUME (no wildcard). TRUE if volume mounted on local server. ACTIVE [Object_Type] (wildcard ok).TRUE if local Dynamic Bindery Object exists (mainly SAPers). LOCAL [Object_Type] (wildcard ok). TRUE if local Static Bindery Object exists. USER (wildcard ok). TRUE if user defined on local server. B) VARIABLES TESTS You can use the > = < test signs to test the value of a NCPLUS environment variable. The test is a string test (strcmp() return codes); therefore the test is done on the ASCII collating sequence AND the length of the string. Important: NO SPACE between variable,test sign and tested value. Exs: IF EXIST DFILE C:\*.BAT ECHO "BATCH FILE EXISTS" ELSE ECHO "NO BATCH FILE" IF EXIST NFILE FS/SYS:RUNFILE EXEC FS/SYS:RUNFILE ELSE ECHO "NO PROCEDURE" IF EXIST NLM MONITOR.NLM UNLOAD MONITOR ELSE LOAD MONITOR -P IFNOT EXIST LOGGED_USER * EXEC BACKUP ELSE SEND PLEASE LOGOUT!! EVERY 60 IF EXIST ACTIVE MYPSERVER,0x47 NOP ELSE SEND "PRINT SERVER GONE!!" is equivalent to EVERY 60 IFNOT EXIST ACTIVE MYPSERVER,0x47 SEND "PRINT SERVER GONE!!" IF EXIST SERVER REMOTE LOGIN REMOTE/GUEST ELSE ECHO "CANNOT LOGIN" is equivalent to IFNOT EXIST SERVER REMOTE ECHO "CANNOT LOGIN" ELSE LOGIN REMOTE/GUEST and equivalent to IF EXIST ACTIVE REMOTE,4 LOGIN REMOTE/GUEST ELSE ECHO "CANNOT LOGIN" and equivalent to IF EXIST ACTIVE REMOTE, LOGIN REMOTE/GUEST ELSE ECHO "CANNOT LOGIN" IF EXIST USER SPECIAL LOGIN THISONE/SPECIAL IF EXIST VOLUME VOL1 CD VOL1: ELSE ECHO "CANNOT CD TO VOL1:" (1) IF %MYCOUNT=001 EXEC SYS:SYSTEM/THIS EVERY 1 IF %TIME=13:45:00 EXEC THIS is equivalent to AT 13:45 EXEC THIS IF %CONNECTIONS>240 USEND SUPERVISOR "CROWDED SERVER!!" (see CONNECTIONS) IF %MYVAR<"ETHERNET" ECHO "COULD BE ARCNET OR ETHER..." (1) Specify volume name without ':' Using a combination of EVERY and IF, you can test regularly the presence of objects on the network: files, volumes, logged users, gateways, print servers and so on. You can detect changes of state and start a corresponding alert or audit procedure. This is particularly useful to check the validity of WAN connections, or presence of any SAPing device/server. See Also: AT, EVERY, ON, PSET, AND TUTORIAL. #IFNOT See Also: IF #KILL KILL: Kills an AT, ON or EVERY background NCPLUS process. Syntax: KILL ALL | Process_ID A background process ID can be found with the command PS. KILL ALL kills all processes. KILL PID kills the corresponding process. A background process can be of 3 types: AT (see AT command). An AT command will exist in the background process list until the specified time is reached. Once executed, the AT command is automatically killed. EVERY (see EVERY command). An EVERY command will exist in the background process list until it is manually removed by the operator with a KILL command, or when NCPLUS is unloaded. ON (see ON command). An ON command will exist in the background process list until it is manually removed by the operator with a KILL command, or when NCPLUS is unloaded. Each background procedure has an execution counter, incremented each time the corresponding command is executed. You can see how many times a background procedure has been executed with the command PS -V. An AT command will have always a counter equals to 0 (executed only once and then killed). WARNING: Do not kill a 'running' process. A running process is a NCPLUS process actually executing commands. If the running process you want to kill is in the middle of a long file i/o, the process will be killed upon i/o termination. Be sure the process you want to kill is waiting (idle). YOU CAN INCLUDE A KILL COMMAND IN A PROCEDURE FILE RUNNING IN BACKGROUND, BUT THIS IS NOT RECOMMENDED.... Exs: KILL ALL KILL 3 NCPLUS will kill all pending background process at unload. NCPLUS users should gracefully unload NCPLUS after killing all background and event driven processes. See Also: AT, EVERY, ON, PS #LOGIN LOGIN: LOGIN as USER on a fileserver Syntax: LOGIN SERVER/USERNAME [password] LOGIN will 'log' NCPLUS on the specified server as a NetWare user. If a password is required, it must be passed on the command line (no input allowed) on the console. Once logged in, NCPLUS will inherit the user rights on the given server. NCPLUS can log on multiple servers (maximum 8: this is an arbitrary limitation). Once logged on a remote server, most of NCPLUS FILE functions will work correctly on the remote server. To change the current fileserver to another server where NCPLUS is logged, use the CD command. Once CD has changed the current directory to a remote directory, all NCPLUS FILE commands will be executed 'on' the remote server. When logging in the primary server, NCPLUS will use a Connection number above the maximum number of connections allowed by the NetWare version. Exs: LOGIN THISONE/SUPERVISOR MARYLIN LOGIN REMOTE/XAVIER LOGIN REMOTE2/ADROON CEO LOGIN FS2/ME %PWD When logging in multiple times on the same server, the last login command will logout previous logins. See Also: WHOAMI, CD, LOGOUT, USERLIST #LOGOUT LOGOUT: Logour NCPLUS from a fileserver Syntax: LOGOUT [FILESERVER_NAME] LOGOUT logs out NCPLUS from the specified fileserver on which NCPLUS was previously logged. LOGOUT with no parameters will logout from all servers. Exs: LOGOUT LOGOUT REMOTE LOGOUT %THISONE See Also: LOGIN, WHOAMI, USERLIST #MD MD: Create a NetWare directory Syntax: MD Netware_directory MD will create a directory if it has sufficient rights to do it. Works on local and remote server. See Also: RD, CD #NDCOPY NDCOPY: Copy a file from a Netware volume to the local DOS partition. Syntax: NDCOPY Netware_filename DOS_filename DOS must be present. Try to avoid copying to local floppies. Wildcard characters NOT allowed. Exs: NDCOPY SYS:SYSTEM/NCL.NLM C:\NW311\NCL.NLM EVERY 60 NDCOPY %CWD\FILE.DTA C:\BACKUP\FILE.DTA IF EXIST NFILE DUMMY.DOC NDCOPY DUMMY.DOC C:\TRASH\DUMMY.DOC Using a combination of EVERY and NDCOPY you can use the local DOS partition as a mini-backup device, or to store log files. See Also: DTYPE, DNCOPY, DDIR #NDIR NDIR: List a Netware directory Syntax: NDIR [Netware_Path] NDIR displays the contents of a directory according to the specified file mask. Wildcard characters allowed. Works on local and remote server. NDIR also supports redirection to a NetWare file. NDIR displays filename, extension, size, creation date and time and NetWare attributes (See FLAG). Exs: NDIR (equivalent to NDIR %CWD\*.*) NDIR REMOTE/SYS:PUBLIC/*.* (List all files) NDIR REMOTE/SYS:PUBLIC (list info on SYS:PUBLIC directory, no files) NDIR SYS:SYSTEM/*.NLM !> NLMLIST See Also: DDIR, FLAG #NNCOPY NNCOPY Copy NetWare files to NetWare files Syntax: NNCOPY Source_file Destination_file NNCOPY Source_filemask Destination_directory NNCOPY allows you to copy one or multiple files from on NetWare directory to another one. Source and destination can be on different volumes and/or servers. Wildcard charcters are allowed. NOTE: Do not attempt to copy large files with NNCOPY when performance is important. You should do large copies when nobody is logged in or when performance is not critic. WARNING: If source files are on a remote server, you must specify the complete path (SERVER/VOLUME:DIRECTORY/MASK). Exs: NNCOPY SYS:SYSTEM/*.NLM REMOTE/SYS:SYSTEM NNCOPY ONE TWO NNCOPY SYS:%SRC VOL1:%DST NNCOPY REMOTE/SYS:PUBLIC/*.MNU THISDIR If you include a NNCOPY in a EVERY command, BE SURE the NNCOPY does not take longer than the EVERY rescheduling time!!! A combination of EVERY and NNCOPY lets you do automatic file duplication from one server to another one. NNCOPY does not modify the Archive attribute, so it cannot really be seen as a way to do backups. See Also: NDCOPY, DNCOPY #NOP NOP: Does nothing Syntax: NOP Why such a command? You may want to have some tests done with no action. Or you can use NOP with ON commands, so the ON counters will be incremented (see PS -V) but no action will take place. Exs: ON LOGIN NOP ON DELOBJ NOP IF %X=3 NOP ELSE ECHO DIFFERENT is equivalent to IFNOT %X=3 ECHO DIFFERENT See Also: ON, IF, PS #NTYPE NTYPE: Display the contents of a NetWare file Syntax: NTYPE NetWare_Filename NTYPE display the contents of a NetWare file onto the Console Screen. As no input is possible on the Console Screen, if the file is more than 25 lines long, you can't stop scrolling. Exs: NTYPE SYS:SYSTEM/AUTOEXEC.NCF NTYPE %THISFILE NTYPE REMOTE/VOL1:USER/XAVIER/NCL.C See Also: DTYPE #ON ON: Execute a command on event notification Syntax: ON command_to_run [command args] where is one of the following: LOGIN when an object logs in the NCPLUS server NEWOBJ when a new object is created in the NCPLUS server bindery DELOBJ when an object is removed from the NCPLUS server bindery MOUNT when a volume is mounted on the NCPLUS server DISMOUNT when a volume is dismounted from the NCPLUS server. UNLOAD when a NLM is unloaded from the NCPLUS server memory. CHGSEC when a security equivalence change occurs on the NCPLUS server. IMPORTANT: DO NOT TRY TO RUN LONG OR HEAVY DUTY TASKS WITH ON. ON commands are treated like AT or EVERY commands, i.e. you can KILL them, or examine them with PS. ON LOGIN generates 2 temporary variables: LOGOBJ: contains the newly logged object name. LOGTYP: contains the object type of the newly object name. ON NEWOBJ generates 2 temporary variables: NEWOBJ: contains the newly created object name. NEWTYP: contains the newly created object type (Hex representation) ON DELOBJ generates 1 temporary variable: DELOBJ: contains the object ID of the deleted object (hex) ON DISMOUNT and ON MOUNT create 1 temporary variable: MOUNTED and DISMOUNTED: contain the name of the (dis)mounted volume. ON UNLOAD generates 1 temporary variable: UNLOADED: contains the unloaded NLM handle ON CHGSEC generates 3 temporary variables: TARGET: contains the bindery object name on which a security equivalence change has occured. ACTION: contains the change: "ADDED" or "REMOVED" EQUIV: contains the bindery object name of the equivalence added or removed for the object TARGET. These variables can be used only as arguments of the command to be executed during an ON. Once this command has been executed, the variables remain in the NCPLUS environment with their last value. Testing them later in other commands will not give a precise idea of what happened. Exs: ON LOGIN "ECHO %LOGOBJ (%LOGTYP) LOGIN AT %TIME !>> SYS:SYSTEM/LOGFILE" ON NEWOBJ "ECHO OBJECT %NEWOBJ (%NEWTYP) CREATED AT %TIME" ON DELOBJ "ECHO OBJECT %DELOBJ DELETED AT %TIME" ON MOUNT SEND VOLUME %MOUNTED (1) ON DISMOUNT SEND VOLUME %DISMOUNT HAS BEEN DISMOUNTED (2) ON CHGSEC ECHO "%TIME: %EQUIV %ACTION FOR USER %TARGET" ON UNLOAD SEND "ALERT!! SOMEBODY UNLOADED %UNLOADED!!" The alias mark "." is not necessary here. the variables will be substituted by their values when the ON command is entered, before the command string is passed back to the main parser. For the others examples, as they contain the %TIME variable, it is necessary to protect the command (or only the variable) on quotes, so %TIME will be substitued with the time of the event notification. See Also: PS, KILL, VARIABLES #PS PS: List the active NCPLUS background processes. Syntax: PS [-V] PS will show the list of active (created) NCPLUS background processes. Column 1 (PID) contains the process ID you must use with the command KILL. Column 2 (Type) contains the background command type: E for EVERY, A for AT, O for ON commands. Column 3 (Freq/Time) contains the execution time (for AT), or the frequence (in secs, for EVERY) or the event (for ON) associated. Column 4 (Command) contains the command that will be executed. PS -V will show more details about the processes: Column 1 (PID) contains the process ID you must use with the command KILL. Column 2 (Type) contains the background command type: E for EVERY, A for AT, O for ON commands. Column 3 (Freq/Time) contains the execution time (for AT), or the frequence (in secs, for EVERY) or the event (for ON) associated. Column 4 (Start-Date) contains the Date at which the command was started. Column 5 (Start-Time) contains the Time at which the command was started. Column 6 (Counter) contains the number of times the command has been executed since it was started. For AT this will be always 0 as AT is executed only once and then killed. For EVERY, this is the number of time the procedure was re-scheduled. For ON, this is the number of times the corresponding event occured. The PID remains the same for a procedure until its termination; i.e. if there are 3 process 1, 2 and 3, once processes 1 and 2 are killed or terminated, process 3 stays #3. NOTE: Be careful when using environment variables as arguments to the command to be run. If you want to have the variable replaced by its value when the command will be run, you need to put the variable between quotes. See the AT example. See Also: KILL, AT, ON, EVERY #PSET PSET: Set/Unset NCPLUS environment variables Syntax: PSET [Variable_name[=value | %other_variable_name]] PSET runs like the DOS SET command (well, almost). You can create variables to be used as arguments to any NCPLUS command, or to any Netware console command, when the command line begins with a '.' (See DOT/ALIASES). To set a variable: PSET variable=string To see the list of variables: PSET If the value contains spaces or '!>', the string must be delimited by quotes: PSET MYNAME=PIERRE DUPONT gives MYNAME=PIERREDUPONT PSET MYNAME="PIERRE DUPONT" gives MYNAME=PIERRE DUPONT PSET COMMAND=USERLIST !>> LOG gives COMMAND=USERLIST PSET COMMAND="USERLIST !>> LOG" gives COMMAND=USERLIST !>> LOG To unset a variable: PSET variable= NOTE: My command parser is not perfect and use of variables is sometimes complex. One solution: Try it for a while... DO NOT SET RESERVED VARIABLES, unless it's said safe. To use a variable, simply use the variable name preceeded by '%'. Exs: PSET UM="UNLOAD MONITOR" PSET LM="LOAD MONITOR -P" PSET NCPLUS_START="NCPLUS STARTED AT" %TIME PSET PWD="SET ALLOW UNENCRYPTED PASSWORDS=" (you can then run .%PWD ON or .%PWD OFF) IMPORTANT: Using variables is NOT a way to create a command longer than 80 characters!!! See Also: DOT, VARIABLES, IF, IFNOT #REN REN: Rename a Netware file Syntax: REN old_file_name new_file_name Ok? Do you need more help on REN? Oh, by the way, REN does not support wildcard characters. NetWare security applies. Runs on local or remote servers Exs: REN OLD NEW REN SYSCON.EXE README.DOC (Ah, Ah!) See Also: Nothing #RD RD: Remove a NetWare Directory Syntax: RD NetWare_directory_name Directory must be empty. NetWare security applies. Runs local or remote Exs: RD SYSTEM (Won't work) RD LOGIN/00000001 RD REMOTE/SYS:THISDIR #SLIST SLIST: List available FILE servers. DISPLAY SERVERS (NW command) displays all SAPing objects. Syntax: SLIST (big deal!) See Dos utility SLIST. SLIST accepts redirection. Exs: SLIST SLIST !>> SYS:SYSTEM/LOG See Also: What else could you possibly need ?? #USEND USEND: Send a message to a specific user Syntax: USEND message where USERNAME is a valid username, logged on the NCPLUS primary server. Exs: ON LOGIN USEND SUPERVISOR "USER %LOGOBJ HAS LOGGED IN AT %TIME" USEND GUEST "BE MY GUEST" See Also: Nothing else to see #USERLIST USERLIST: List logged usernames Syntax: USERLIST Is that simple? Supports redirection to a file. Runs local or remote. See Also: SLIST (?) #WAIT WAIT: Wait the specified amount of time. Syntax: WAIT nb_of_seconds WARNING: While WAIT is waiting, the console command also waits, so no way to enter an other command..... WAIT is primarly used in 'batch' files (see EXEC) to give some time to another process before executing the next batch command: For example after a BIND, wait 5 seconds before login on a remote server. WAIT 36000000 will secure your console for a while!!!! (Big red switch to stop it...) #WHOAMI WHOAMI: Give connections used by NCPLUS (NCPLUS logged) Syntax: WHOAMI If a previous LOGIN command has been entered, WHOAMI will give information about the connection. By the way, you can login up to 8 different servers. #DOT DOT COMMANDS DOT commands are not NCPLUS commands, but normal console commands in which you want to use NCPLUS variables. Suppose you want to issue the following command: LOAD %THISNLM NetWare will return Can't find %THISNLM because variable substitutionis not done by the main command parser. If you begin your command line by a dot '.', the console parser will not recognize the command and will pass it to the next parser. If NCPLUS is loaded, it will get the command, substitute the variable(s), remove the leading dot and pass the command back to the main parser where it can be executed normally. For the above example you can type .LOAD %THISNLM #VARIABLES NCPLUS VARIABLES NCPLUS has a set of pre-defined variables you can use with any NCPLUS or DOT command: TIME: updated every time a NCPLUS command is issued. Format HH:MM:SS DATE: Idem. Format: DD/MM/YY (default) or MM/DD/YY if DFORMAT=US DFORMAT: date format. Not set = European format (DD/MM/YY) EU = European format US = US format (MM/DD/YY) CWD: Current Working Directory. Updated every time a NCPLUS command is issued. If no file system is mounted (i.e down server or external router), CWD="NO_FILE_SYSTEM".If working on a remote server, CWD contains the remote Cwd. DFS: Default (primary) fileserver running NCPLUS LOGOBJ: Name of the last logged in object (Set by ON LOGIN only) LOGTYP: Type of the last logged object (Set by ON LOGIN only) NEWOBJ: Name of the last created object (Set by ON NEWOBJ only) NEWTYP: Type of the last created object (Set by ON NEWOBJ only) DELOBJ: Unique ID of the last deleted object (Set by ON DELOBJ only) MOUNTED: Volume name of the last mounted volume (Set by ON MOUNT only) DISMNTED:Volume name of the last dismounted volume (Set by ON DISMOUNT only) EQUIV: Equivalence name added/removed for a user (Set by ON CHGSEC only) TARGET: Name of user for which a security equivalence change occured (idem) ACTION: ADDED / REMOVED (idem) # You can start to add help topics here.....