Novell Login calling a batch

I'm fairly new at the when it comes to writing for Novell. I've documented what I think I need for someone to look at. My script is to test for OS and then call a batch file for that OS that will then test if file exist. I have the directory prepared for what files I want to call.  Also I can admit the my syntax may be off as far as where and when to use "" marks.  The first bit of code is the login script the next two are the contents of either batch file that will be called.  Any help would be greatly appreciated.

This is Novell Login Script

;No Default Login script will execute
NO DEFAULT

;Keeping screen clear
MAP DISPLAY OFF
MAP ERRORS OFF

;Preparing path
MAP INS S1:=%FILE_SERVER\SYS:SWEEP1

;Checking for OS type
IF "%OS"="WIN95" OR "%OS" = "WIN98" THEN
    WRITE "**Checking for SOPHOS Anti-Virus!!**"
    #S1:\%FILE_SERVER\SYS:SWEEP1\SOPHOSINST98.bat

;Is this part right?
    ELSE
    "%OS"="WINNT"
    WRITE "**Checking for SOPHOS Anti-Virus!!**"
    #S1:\%FILE_SERVER\SYS:SWEEP1\SOPHOSINSTNT.bat
END

;Removing Setup path
MAP DEL S1

;Mapping rest of drives
IF "%FILE_SERVER"="AHS_FS1" OR "%FILE_SERVER"="GAR_FS1" THEN
     MAP ROOT F:=%FILE_SERVER\VOL1:APPS
     MAP ROOT S:=%FILE_SERVER\VOL1:SHARED
     MAP ROOT U:=%FILE_SERVER\%HOME_DIRECTORY
ELSE
     MAP ROOT F:=%FILE_SERVER\SYS:APPS
     MAP ROOT S:=%FILE_SERVER\SYS:SHARED
     MAP ROOT U:=%FILE_SERVER\%HOME_DIRECTORY
END

This is the batch file for '95 or '98

@echo off
        IF NOT EXIST "C:\UNNORTON.BAT" THEN
        COPY SYS:SWEEP1\UNNORTON.BAT C:\
        SYS:SWEEP1\REMUPD\SETUP.EXE -S
        END
   
        ELSE
        IF EXIST "C:\PROGRAM FILES\SOPHOS\REMOTE UPDATE\REMUPD.EXE" THEN
                  COPY "SYS:SWEEP1\SAVAGENT.EXE" "C:\PROGRAM FILES\SOPHOS"
                  COPY "SYS:SWEEP1\SAVAGENT.LNK" "C:\%WINDIR%\START MENU\PROGRAMS\START UP"
       
        END

This is the batch file for NT

@echo off
        IF NOT EXIST "C:\UNNORTONNT.BAT" THEN
        COPY SYS:SWEEP1\UNNORTONNT.BAT C:\
        SYS:SWEEP1\REMUPD\SETUP.EXE -S
        END
   
        ELSE
        IF EXIST "C:\PROGRAM FILES\SOPHOS\REMOTE UPDATE\REMUPD.EXE" THEN
                  COPY "SYS:SWEEP1\SAVAGENT.EXE" "C:\PROGRAM FILES\SOPHOS"
                  COPY "SYS:SWEEP1\SAVAGENT.LNK" "C:\Documents and Settings\All Users\Start Menu\Programs\Startup"
       
        END
walleyemanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PsiCopCommented:
The proper syntax to avoid the Default Login script is --> NO_DEFAULT

Instead of using MAP S1:, I would map a specific drive letter, or use UNC notation.

You haven't bothered to specify the VERSION of NetWare, and the capabilities of the LOGIN program do vary by version (for example, the CALL keyword is not available in NetWare v3.x, but is in NetWare v6.x), so accurately responding to your Question is difficult.
0
DSPooleCommented:
add to top:

DOS SET MAPROOTOFF = "1"

change:

MAP ROOT U:=%FILE_SERVER\%HOME_DIRECTORY

to:

MAP ROOT U:=%HOME_DIRECTORY

change:

#S1:\%FILE_SERVER\SYS:SWEEP1\SOPHOSINST98.bat

to:

@S1:\%FILE_SERVER\SYS:SWEEP1\SOPHOSINST98.bat

change:

#S1:\%FILE_SERVER\SYS:SWEEP1\SOPHOSINSTNT.bat

to:

@S1:\%FILE_SERVER\SYS:SWEEP1\SOPHOSINSTNT.bat
0
walleyemanAuthor Commented:
The version of Novell is 5.1 with 4.83 sp2 clients.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

walleyemanAuthor Commented:
Opps Novell 5.1 has sp 6
0
ShineOnCommented:
Rather than using the %FILE_SERVER variable in your MAP command, assuming that the SWEEP directory exists on the SYS vol of all servers, you should be able to do a mapping (to a specific drive letter) simply using SYS:\SWEEP1 :

map root s:=sys:\sweep1

Once you have done that, you should call the BAT file using the drive letter mapping without specifying server or volume:

#s:\sophosinst98.bat
-or-
#s:\sophosinstnt.bat


Plus, I don't know that your batch files will work using SYS: as a "drive" designator.  Since you are creating a temporary mapping for SYS:\SWEEP1 already, use that drive letter in your batch file:

COPY S:\UNNORTON.BAT C:\
instead of
COPY SYS:SWEEP1\UNNORTON.BAT C:\

etc.

In your if-then logic, I would comment out the line "%OS"="WINNT" since you are apparently assuming that if it's not Win95 or Win98 that it is WinNt.  The else will handle that for you.

Replace your map del S1 with map del S: to reset your temporary mapping following execution of the external commands.

With the conditional mapping of directories to vol1 or sys depending on what file server it is, I would use the %FILE_SERVER variable only in the IF statement and not in the commands.  The login server is assumed if you only give a volume name.  Also, since the file server defined as part of the %HOME_DIRECTORY variable in the user object, you shouldn't use %FILE_SERVER as part of the home directory mapping:

IF "%FILE_SERVER"="AHS_FS1" OR "%FILE_SERVER"="GAR_FS1" THEN
     MAP ROOT F:=VOL1:APPS
     MAP ROOT S:=VOL1:SHARED
ELSE
     MAP ROOT F:=SYS:APPS
     MAP ROOT S:=SYS:SHARED
END
     MAP ROOT U:=%HOME_DIRECTORY

I won't preach about putting user data on SYS.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PsiCopCommented:
Hmmm...then I will.

In NetWare v4.x and later, its a Bad Idea (tm) to allow users to have WRITE permission ANYWHERE on SYS:.

The danger is that a user could run the SYS: Volume out of space, shutting down Transaction Tracking System (TTS), and killing NDS. At best you'll be rebooting the server and cleaning up SYS: before people can login, at worst you'll have a hosed NDS database on your hands. There's another open Question in this TA where I think this exact thing has happened to the Asker - his SYS: Volume got run out of space, TTS choked and NDS got hosed. If he's lucky, a call to Novell TS will fix it.

You should create one or more Volumes on which to store user data. This does NOT have to break anything. All ya gotta do is modify the appropriate MAP statements in the login script.
0
ShineOnCommented:
On the recommendation by DSPoole to use @ instead of # - I think you should stick with the #, since you want to use a temporary mapping.  You don't want the temporary mapping to be deleted before the batch file completes.

I was thinking along the same lines - that you don''t necessarily want to hold up login script processing for the batch file - but changed my mind when I took the temporary mapping into consideration.

That's the difference between @ and # - the @ allows the login script to continue without waiting for the external command to complete, while the # will essentially pause the login script until the external command finishes.
0
PsiCopCommented:
Also, note that you do NOT have to do this all in one login script.

Using the CALL keyword, you can call other login scripts from within a login script.

You can also make use of individual user login scripts, althgo I generally shy away from that unless there's something very specific to one user.

If you use User Profiles, there is the Profile Login Script.

I'm pointing out these options because you said you were new to writing scripts for the NetWare environment, and I wanted you to know the *options* you have. Even if you don't use them all, you should know what tools are in your toolbox.
0
DSPooleCommented:
"That's the difference between @ and # - the @ allows the login script to continue without waiting for the external command to complete, while the # will essentially pause the login script until the external command finishes."

My bad - I thought @ made the pause and # processed regardless.  If I got it backwards, my intent was for the login script to pause before processing the next command.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Novell Netware

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.