Link to home
Start Free TrialLog in
Avatar of rigsby
rigsby

asked on

Errorlevels???????

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.............?????????????
ASKER CERTIFIED SOLUTION
Avatar of BlackMan
BlackMan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rigsby
rigsby

ASKER

BlackMan:  Have tried this with no success....but thank you for your response!!
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?
Avatar of rigsby

ASKER

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
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
Avatar of rigsby

ASKER

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?
Could you post a few more lines (or all) of you BAT file? It might help..