Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Errorlevels???????

Posted on 1998-05-27
7
Medium Priority
?
523 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
[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
  • 4
  • 3
7 Comments
 
LVL 7

Accepted Solution

by:
BlackMan earned 60 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Greetings, Experts! First let me state that this website is top notch. I thoroughly enjoy the community that is shared here; those seeking help and those willing to sacrifice their time to help. It is fantastic. I am writing this article at th…
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 …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

610 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