Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Batch File: Auto login in Novell doesn't always worked.

Posted on 2004-03-30
16
Medium Priority
?
1,731 Views
Last Modified: 2012-08-13
For some reason my batch file doesn't work all of the time.  It brings up a Novell Login box, but it doesn't automatically login.  Sometimes I have to manually click the 'OK' box.  Does anyone have any suggestions so it will work automatically?

 @echo off
echo.

if exist \\server1\test1\*.* goto MAPME
  loginw32 somsc/%username% /pwd test /ns /tr

  echo Checking Network Rights, Please wait ù ù ù
  echo.

  if exist \\server1\test1\*.* goto MAPME
    echo.
    echo ****   Error.  Global Connection Failed!   ****
    echo           Drive G: can NOT be Mapped.
    echo.
    pause
    goto QUIT

:MAPME
  if exist G:\test1\nul goto QUIT
    if exist G:\nul net use G: /delete /yes
    net use G: \\server1\test1 /persistent:no

:QUIT
0
Comment
Question by:mystikal1000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
16 Comments
 
LVL 11

Expert Comment

by:Joseph O'Loughlin
ID: 10718319
Hi mystikal1000,
The script only attemts to log you in if there has not been a previous authentication to the server, so move the login attempt to directly after @echo off
usual disclaimers apply
0
 
LVL 1

Author Comment

by:mystikal1000
ID: 10719008
I am not sure what you mean by that.  I thought this has been done above?
0
 
LVL 11

Expert Comment

by:Joseph O'Loughlin
ID: 10721201
Hi,
The line
if exist \\server1\test1\*.* goto MAPME
skips the login step if there are already credentials that allow test1 to be accessed
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 1

Author Comment

by:mystikal1000
ID: 10724750
Should I include if exist \\server1\test1\*.* goto MAPME ?
0
 
LVL 11

Expert Comment

by:Joseph O'Loughlin
ID: 10725978
Yes, the 2nd time.  No need for it twice
0
 
LVL 1

Author Comment

by:mystikal1000
ID: 10726348
Why do you think that is the cause of my problem?
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 10728210
I have a suggestion...if you're ultimately trying to map G - try it this way - kind of backwards, but saves on useless processing...

@echo off
:start

if exist g:\nul goto G_Chk
::if G is already mapped, make sure it's mapped properly
::if G is not mapped, check share presence

if not exist \\server1\test1\* goto Login
goto G_Chk
 
:Login
loginw32 somsc/%username% /pwd test /ns /tr
goto start

:G_Chk
  if exist G:\test1\nul goto QUIT
  net use G: /delete /yes
  net use G: \\server1\test1
  if errorlevel==0 goto QUIT
  cls
  echo. Unable to connect.
  echo.
  echo. Press Ctrl + C to abort.  
  echo. To retry -
  pause
  goto start

:QUIT
0
 
LVL 1

Author Comment

by:mystikal1000
ID: 10733180
What makes you think this batch file will work better, Sirbounty?
0
 
LVL 11

Expert Comment

by:Joseph O'Loughlin
ID: 10734315
Sir Bounty's batch file makes fewer assumptions.
For example it would cope with the drive connection being cached from when an notebook was last on the network.
It accomplishes the implied objectives faster, without authenticating to the server when not needed.
0
 
LVL 1

Author Comment

by:mystikal1000
ID: 10735405
I ran the batch file and it doesn't automatically login from the netware login screen, you have to click 'ok' to login.
0
 
LVL 11

Expert Comment

by:Joseph O'Loughlin
ID: 10736907
Try a 2nd time.  Try when disconnected.  Try when loged in as someone else.  What permutations prompt?
0
 
LVL 11

Accepted Solution

by:
Joseph O'Loughlin earned 1500 total points
ID: 10760963
See http://support.novell.com/cgi-bin/search/searchtid.cgi?/2935829.htm
Try adding the tree name to
loginw32 somsc/%username% /pwd test /ns /tr
0
 
LVL 1

Author Comment

by:mystikal1000
ID: 10768028
somsc is the tree.  What else to try?
0
 
LVL 11

Expert Comment

by:Joseph O'Loughlin
ID: 10770085
Forget about the rest of the batch file.  Try the line
loginw32 somsc/%username% /pwd test /ns /tr
on it's own.  Is there any pattern to when it asks for the <ok> conformation?
In those circumstances try
loginw32 somsc/%username% /ns /tr somec /pwd test
If the same problem results are the users in question in the same or different OUs?
0
 
LVL 4

Expert Comment

by:venishjoe
ID: 10773574
0
 
LVL 1

Author Comment

by:mystikal1000
ID: 10790859
It looks like the addition /cont fixed the issue.  Thanks for your help everyone.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

670 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