Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Novell Login calling a batch

Posted on 2004-10-26
9
Medium Priority
?
1,047 Views
Last Modified: 2012-06-21
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
0
Comment
Question by:walleyeman
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 34

Expert Comment

by:PsiCop
ID: 12410968
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
 
LVL 10

Assisted Solution

by:DSPoole
DSPoole earned 400 total points
ID: 12412487
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
 

Author Comment

by:walleyeman
ID: 12412821
The version of Novell is 5.1 with 4.83 sp2 clients.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:walleyeman
ID: 12412830
Opps Novell 5.1 has sp 6
0
 
LVL 35

Accepted Solution

by:
ShineOn earned 1200 total points
ID: 12412915
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
 
LVL 34

Assisted Solution

by:PsiCop
PsiCop earned 400 total points
ID: 12413166
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
 
LVL 35

Expert Comment

by:ShineOn
ID: 12413681
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
 
LVL 34

Expert Comment

by:PsiCop
ID: 12413761
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
 
LVL 10

Expert Comment

by:DSPoole
ID: 12413859
"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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
LinkedIn blogging is great for networking, building up an audience, and expanding your influence as well. However, if you want to achieve these results, you need to work really hard to make your post worth liking and sharing. Here are 4 tips that ca…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month21 days, 6 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question