Using DOS Batch Files with NetWare 4 to Ease the Transition from NetWare 3
Articles and Tips: article
Senior Research Engineer
Novell Research
01 Aug 1994
DOS users who have migrated from NetWare 3 to NetWare 4 may have noticed that some of the familiar NetWare 3 utilities are not in NetWare 4. Although NetWare 4 installs simple batch files to inform the unwary user that a particular utility is no longer supported, it would be more helpful if the batch file ran the NetWare 4 equivalent. This AppNote gives source code to DOS batch files that will do precisely that, to help smooth the transition to NetWare 4 for veteran NetWare users.
Batch File Support for NetWare 3 Nostalgia
NetWare 4 comes with a different set of DOS utilities than NetWare 3. Some new utilities were introduced, and the functionality of others was combined. This reduced the number of utilities that new NetWare users had to become familiar with, but it created problems for those who have been using NetWare for several years. I just can't seem to break the habit of trying to run SLIST when I want to find out if a particular server is up. NetWare 4 has a batch file called SLIST.BAT that displays the message:
This utility is no longer supported with v4.0. Use NLIST Server /B
While this message is helpful, wouldn't it be better if the batch file took the next step and called NLIST for you? The 1024th time I saw the "This utility is no longer supported with v4.0." message, I decided it was time to edit the batch files in my SYS:PUBLIC directory so that I would never see this message again.
As with nearly all projects, rewriting these batch files turned out to be a little more difficult than it first appeared. On a NetWare 4 file server, there are 24 batch files in the SYS:PUBLIC directory. Two of them, MENU_X.BAT and NMENU.BAT, are used by the NetWare 4 menu system. With each of the remaining 22 files, I intended to write batch files that passed command line parameters to the new NetWare 4 utility so it would run the same as the no-longer-supported NetWare 3 utility.
With three of the files - GRANT.BAT, REMOVE.BAT, and REVOKE.BAT - the command line syntax was too complicated to convert, given the limitations of DOS batch files. With DSPACE.BAT, the functionality of the NetWare 3 DSPACE utility was split between two NetWare 4 utilities, FILER and NETADMIN, so there was no way to tell which utility to run. That left 18 batch files that I was able to rewrite with some success.
This AppNote lists the contents of these batch files. Each one has a command line option (/?) that displays the batch file's command line syntax. It also displays the command line syntax for the corresponding NetWare 4 utility. In the text, I have noted any limitations the batch files have relative to the corresponding NetWare 3 utilities.
You can find these batch files in the directory /novell/appnotes/1994/august/2 on the Novell Research CD-ROM. You may also click on the name of each batch file and select "Save to File" when asked to retrieve it. |
ALLOW.BAT
@ECHO OFF if "%1"=="/?" goto usage if "%1"=="" goto noopt rights %1 %2 %3 %4 %5 %6 %7 %8 %9 /F goto end :noopt rights *.* /F goto end :usage echo ALLOW.BAT echo Usage: ALLOW [path [rightslist]] echo or use RIGHTS [path [rightslist] /F :end
ATTACH.BAT
The NetWare 3 ATTACH utility prompts you for a server name and user name if they are not specified on the command line. ATTACH.BAT requires you to specify both the file server and user name. For example, to attach to file server DANGER as user PHILO, you must run ATTACH DANGER/PHILO.
@ECHO OFF if "%1"=="" goto usage if "%1"=="/?" goto usage login %1 /NS if %errorlevel==1 goto usage goto end :usage echo ATTACH.BAT echo Usage: ATTACH fileserver/username echo or use LOGIN fileserver/username /NS :end
CASTOFF.BAT
@ECHO OFF if "%1"=="/?" goto usage if "%1"=="ALL" goto all if "%1"=="All" goto all if "%1"=="all" goto all rem you can add lines for "ALl" "AlL" "aLL" "alL" "aLl" if you want, rem but this is getting ridiculous send /A=C if %errorlevel==1 goto usage goto end :all send /A=N if %errorlevel==1 goto usage goto end :usage echo CASTOFF.BAT echo Usage: CASTOFF [All] echo or use SEND /A=C :end
CASTON.BAT
@ECHO OFF if "%1"=="/?" goto usage send /A if %errorlevel==1 goto usage goto end :usage echo CASTON.BAT echo Usage: CASTON echo or use SEND /A :end
CHKDIR.BAT
CHKDIR.BAT calls NetWare 4's NDIR utility, which converts an initial backslash to a forward slash. You must therefore use a volume or drive specification to get directory space information on a full path. For example, you must use CHKDIR f:\users, not CHKDIR \users.
@ECHO OFF if "%1"=="/?" goto usage ndir %1 /SPA if %errorlevel==1 goto usage goto end :usage echo CHKDIR.BAT echo Usage: CHKDIR [path] echo or use NDIR [path] /SPA :end
CHKVOL.BAT
In NetWare 3, CHKVOL allowed you to use wildcards to specify a volume name (S* would give volume statistics for all volumes that start with "S"). This doesn't work with CHKVOL.BAT. Running CHKVOL.BAT with no parameters displays volume statistics on the volume to which the default drive is mapped. Running CHKVOL * gives volume statistics for all volumes on the preferred server.
@ECHO OFF if "%1"=="/?" goto usage ndir %1 /VOL if %errorlevel==1 goto usage goto end :usage echo CHKVOL.BAT echo Usage:CHKVOL [path] echo or use NDIR [path] /VOL :end
ENDCAP.BAT
@ECHO OFF if "%1"=="/?" goto usage CAPTURE /ENDCAP %1 %2 if %errorlevel==1 goto usage goto end :usage echo ENDCAP.BAT echo Usage: ENDCAP [/CANCEL] [/LOCAL=N] echo or: ENDCAP [/CANCEL] [/ALL] echo or use CAPTURE /ENDCAP :end
FLAGDIR.BAT
@ECHO OFF if "%1"=="" goto usage if "%1"=="/?" goto usage flag %1 %2 %3 %4 %5 %6 /DO if %errorlevel==1 goto usage goto end :usage echo FLAGDIR.BAT echo Usage: FLAGDIR [path [flags]] echo Flags: N Normal echo SY System echo H Hidden echo P Purge echo DI DeleteInhibit echo RI RenameInhibit echo or use FLAG [path [flags]] /DO :end
LISTDIR.BAT
LISTDIR.BAT only accepts one command-line option at a time: /R, /E, /D, /S, or /A.
@ECHO OFF if "%1"=="/?" goto usage if "%1"=="/E" goto rights1 if "%1"=="/e" goto rights1 if "%1"=="/A" goto all1 if "%1"=="/a" goto all1 if "%2"=="/R" goto rights2 if "%2"=="/r" goto rights2 if "%2"=="/E" goto rights2 if "%2"=="/e" goto rights2 if "%2"=="/D" goto date if "%2"=="/d" goto date if "%2"=="/S" goto subdir if "%2"=="/s" goto subdir if "%2"=="/A" goto all2 if "%2"=="/a" goto all2 ndir %1 /DO if %errorlevel==1 goto usage goto end :rights1 ndir /R /DO if %errorlevel==1 goto usage goto end :all1 ndir /R /DA /S /DO if %errorlevel==1 goto usage goto end :rights2 ndir %1 /R /DO if %errorlevel==1 goto usage goto end :date ndir %1 /DA /DO if %errorlevel==1 goto usage goto end :subdir ndir %1 /S /DO if %errorlevel==1 goto usage goto end :all2 ndir %1 /R /DA /S /DO if %errorlevel==1 goto usage goto end :usageecho LISTDIR.BAT echo Usage: LISTDIR [path [option]] echo options /R Rights echo /E Effective rights echo /D Date/time echo /S Subdirectory echo /A All echo or use NDIR [path] /DO :end
SALVAGE.BAT
File salvaging was incorporated into NetWare 4's FILER utility.
@ECHO OFF filer
SESSION.BAT
NetWare 4's NETUSER utility incorporates all the functionality that was in NetWare 3's SESSION utility.
@ECHO OFF netuser
SLIST.BAT
@echo off if "%1"=="" goto all if "%1"=="/?" goto usage nlist Server = %1 /B if %errorlevel==1 goto usage goto end :all nlist Server /B if %errorlevel==1 goto usage goto end :usage echo SLIST.BAT echo Usage: SLIST [Servername] echo Servername may include wildcards echo or use NLIST Server [= Servername] /B :end
SMODE.BAT
Running SMODE.BAT with no file specification displays flags for all files, not just executable files. The flag display includes search mode for executables. When changing a file's search mode, do not use the /M command line option that was optional with NetWare3's SMODE utility, just specify the new mode number. For example, run SMODE FILE.EXE 0, rather than SMODE FILE.EXE /M=0.
@ECHO OFF if "%1"=="" goto all if "%1"=="/?" goto usage if "%1"=="/S" goto subdir1 if "%1"=="/s" goto subdir1 if "%2"=="" goto filespec if "%2"=="/S" goto subdir2 if "%2"=="/s" goto subdir2 flag %1 /M=%2 if %errorlevel==1 goto usage goto end :all flag if %errorlevel==1 goto usage goto end :subdir1 flag *.* /S if %errorlevel==1 goto usage goto end :subdir2 flag %1 /S if %errorlevel==1 goto usage goto end :filespec flag %1 if %errorlevel==1 goto usage goto end :usageecho SMODE.BAT echo Usage: SMODE [path [mode]] /S echo option /S include subdirectories echo modes: 0 shell default search mode echo 1 search on all opens with no path echo 2 do not search echo 3 search on read-only opens with no path echo 4 reserved (do not use) echo 5 search on all opens echo 6 reserved (do not use) echo 7 search on all read-only opens echo or use FLAG path /M=mode :end
SYSCON.BAT
NetWare 4's NETADMIN utility incorporates all the functionality of NetWare 3's SYSCON utility.
@ECHO OFF netadmin
TLIST.BAT
The NetWare 3 TLIST utility allowed you to specify whether you wanted to see just user or group trustee assignments for a specified path. TLIST.BAT always displays both user and group trustee assignments.
@ECHO OFF if "%1"=="/?" goto usage rights %1 /T if %errorlevel==1 goto usage goto end :usage echo TLIST.BAT echo Usage: TLIST [path] echo or use rights [path] /T :end
USERLIST.BAT
USERLIST.BAT only displays users logged in to the preferred file server. USERLIST.BAT does not accept the /A command line option, but this option is unnecessary, since NetWare 4's NLIST displays the user's network and node addresses. USERLIST.BAT does not accept the /O option (which displays the object type of each object logged in to the file server); it only displays user objects that are logged in.
@echo off if "%1"=="/?" goto usage if "%1"=="" goto all nlist User = %1 /A /B if %errorlevel==1 goto usage goto end :all nlist User /A /B if %errorlevel==1 goto usage goto end :usage echo USERLIST.BAT echo Usage: USERLIST echo or use NLIST USER [= username] /A /B :end
VERSION.BAT
@ECHO OFF if "%1"=="/?" goto usage ndir %1 /ver if %errorlevel==1 goto usage goto end :usage echo VERSION.BAT echo Usage: VERSION [path] echo or use NDIR [path] /VER :end
VOLINFO.BAT
NetWare 4's FILER utility incorporates all the functionality that was in NetWare 3's VOLINFO utility.
@ECHO OFF filer
Source Code
If you don't want to type in the batch files, you can download them from the NetWire forum on CompuServe, Type GO NOVLIB and access Library 11. They are in a self-extracting archive file named N4BATS.EXE.
* Originally published in Novell AppNotes
Disclaimer
The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.