Solved

Network drive to changeing share names

Posted on 2013-10-28
3
483 Views
Last Modified: 2013-10-28
I have a NAS and I need to backup to it's USB drive. However, each USB drive makes  a different share name when connected.
So I need a script to connect a drive to one of 3 different share names.

Like this:

Net Use Z: \\server\share1
or, if not available
Net Use Z: \\server\share2
or, if not available
Net Use Z: \\server\share3

Batch file or VBS would be great!
Any ideas!
0
Comment
Question by:OneGoodGeek
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
Dan Craciun earned 500 total points
Comment Utility
Why not use those exact commands in a .bat?

net use Z: \delete
net use Z: \\server\share1
net use Z: \\server\share2
net use Z: \\server\share3

It will connect on the working one and error on the rest.

HTH,
Dan
0
 

Author Closing Comment

by:OneGoodGeek
Comment Utility
Ok, I feel stupid how easy that was!

Thanks a lot!
0
 
LVL 34

Expert Comment

by:Dan Craciun
Comment Utility
I usually feel relieved if a solution is easy :) One less complicated thing to maintain.

You're welcome!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

744 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