Solved

Errorlevels???????

Posted on 1998-05-27
7
516 Views
Last Modified: 2013-12-23
Ok. For 30 points:

Who can tell me the method for testing for a successful connection to a network drive from within a DOS batch (.bat) file.

That is I want to cater for the failure of something similar to the following:

IF NOT EXIST x:\directory NET USE x: \\Share\directory

Any suggestions.............?????????????
0
Comment
Question by:rigsby
  • 4
  • 3
7 Comments
 
LVL 7

Accepted Solution

by:
BlackMan earned 30 total points
ID: 1548829
Try:
NET USE X: \\server\share
IF ERRORLEVEL 1 GOTO NOTCONNECTED
bla
bla
GOTO DONE
:NOTCONNECTED
ECHO Error
:DONE
0
 

Author Comment

by:rigsby
ID: 1548830
BlackMan:  Have tried this with no success....but thank you for your response!!
0
 
LVL 7

Expert Comment

by:BlackMan
ID: 1548831
That's weird, i use the excatly same thing in a loginscript (on NT) and it works like a charm?
I'll see if i can dig another solution up for you - is it for use in loginscripts?
0
New My Cloud Pro Series - organize everything!

With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

 

Author Comment

by:rigsby
ID: 1548832
Even with IF ERRORLEVEL 1....etc I receive the following error which is redirected to a log file.

Error 88: An error occurred while data was being written to the disk. Data
might have been lost. Ensure that the disk you want to write to has enough
space available, and that you have write permission for the file, and then
try again.

It appears that the IF statement has no effect. I try it with an available network drive and then with the same drive made un-available. Yes I have used...IF ERRORLEVEL 0 and yes it works but on both....you just can't win can you :-)

Does this help
0
 
LVL 7

Expert Comment

by:BlackMan
ID: 1548833
It could be because Win95 tries to write the log file on a networkdisk. Try to put a C:\ in the start of your BAT file to assure that you are on a local drive. If the BAT file runs as a loginscript, you will have to do that trick
0
 

Author Comment

by:rigsby
ID: 1548834
BlackMan: Your assistance IS very much appreciated!!!!!!

I have tried placing a c:\ at the start (or before the NET USE command) and got ERROR 50. Basically saying that the action is not available from my computer.

The bat file in question is not part of any login script but is a stand alone routine for performing back-up.

Any more ideas?
0
 
LVL 7

Expert Comment

by:BlackMan
ID: 1548835
Could you post a few more lines (or all) of you BAT file? It might help..
0

Featured Post

New My Cloud Pro Series - organize everything!

With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

Join & Write a Comment

FIPS stands for the Federal Information Processing Standardisation and FIPS 140-2 is a collection of standards that are generically associated with hardware and software cryptography. In most cases, people can refer to this as the method of encrypti…
We recently endured a series of broadcast storms that caused our ISP to shut us down for brief periods of time. After going through a multitude of tests, we determined that the issue was related to Intel NIC drivers on some new HP desktop computers …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now