Solved

Errorlevels???????

Posted on 1998-05-27
7
517 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Server 2012 RRAS kills network connectivity 6 92
Weird Issues with AD GPOs 5 86
Map Drive from Server to Server Share via Internet 3 43
sync conflicts 1 56
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…
Enterprise networks where VoIP phones have been deployed frequently use port configurations that allow both a computer and an IP phone to be plugged into the same switch port but use different VLANs. On Cisco equipment I'm referring to the "native V…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 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